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===DONE=== 26--EXPECT-- 27array(2) { 28 [0]=> 29 int(71) 30 [1]=> 31 int(71) 32} 33array(2) { 34 [0]=> 35 int(71) 36 [1]=> 37 int(299) 38} 39===DONE=== 40--CLEAN-- 41<?php 42@unlink(__DIR__ . DIRECTORY_SEPARATOR . 'imageresolution_jpeg.jpeg'); 43?> 44