1--TEST-- 2Set and get image resolution of PNG images 3--EXTENSIONS-- 4gd 5--SKIPIF-- 6<?php 7if (!(imagetypes() & IMG_PNG)) { 8 die("skip No PNG support"); 9} 10?> 11--FILE-- 12<?php 13$filename = __DIR__ . DIRECTORY_SEPARATOR . 'imageresolution_png.png'; 14 15$exp = imagecreate(100, 100); 16imagecolorallocate($exp, 255, 0, 0); 17 18imageresolution($exp, 71); 19imagepng($exp, $filename); 20$act = imagecreatefrompng($filename); 21var_dump(imageresolution($act)); 22 23imageresolution($exp, 71, 299); 24imagepng($exp, $filename); 25$act = imagecreatefrompng($filename); 26var_dump(imageresolution($act)); 27?> 28--EXPECT-- 29array(2) { 30 [0]=> 31 int(71) 32 [1]=> 33 int(71) 34} 35array(2) { 36 [0]=> 37 int(71) 38 [1]=> 39 int(299) 40} 41--CLEAN-- 42<?php 43@unlink(__DIR__ . DIRECTORY_SEPARATOR . 'imageresolution_png.png'); 44?> 45