imagewbmp.phpt 598 B

123456789101112131415161718192021222324252627282930
  1. --TEST--
  2. imagewbmp
  3. --SKIPIF--
  4. <?php
  5. if (!function_exists('imagecreatefromwbmp')) die("skip gd extension not available\n");
  6. ?>
  7. --FILE--
  8. <?php
  9. $file = dirname(__FILE__) . '/im.wbmp';
  10. $im = imagecreatetruecolor(6,6);
  11. imagefill($im, 0,0, 0xffffff);
  12. imagesetpixel($im, 3,3, 0x0);
  13. imagewbmp($im, $file);
  14. $im2 = imagecreatefromwbmp($file);
  15. echo 'test create wbmp: ';
  16. $c = imagecolorsforindex($im2, imagecolorat($im2, 3,3));
  17. $failed = false;
  18. foreach ($c as $v) {
  19. if ($v != 0) {
  20. $failed = true;
  21. }
  22. }
  23. echo !$failed ? 'ok' : 'failed';
  24. echo "\n";
  25. unlink($file);
  26. ?>
  27. --EXPECT--
  28. test create wbmp: ok