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