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