imageresolution_png.phpt 681 B

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