createfromgd2.phpt 567 B

12345678910111213141516171819202122232425
  1. --TEST--
  2. imagecreatefromgd2
  3. --EXTENSIONS--
  4. gd
  5. --SKIPIF--
  6. <?php
  7. if (!function_exists('imagecreatefromgd2')) die("skip gd extension not available\n");
  8. ?>
  9. --FILE--
  10. <?php
  11. $file = __DIR__ . '/src.gd2';
  12. $im2 = imagecreatefromgd2($file);
  13. echo 'test create from gd2: ';
  14. echo imagecolorat($im2, 4,4) == 0xffffff ? 'ok' : 'failed';
  15. echo "\n";
  16. $im3 = imagecreatefromgd2part($file, 4,4, 2,2);
  17. echo 'test create from gd2 part: ';
  18. echo imagecolorat($im2, 4,4) == 0xffffff ? 'ok' : 'failed';
  19. echo "\n";
  20. ?>
  21. --EXPECT--
  22. test create from gd2: ok
  23. test create from gd2 part: ok