imagewbmp.phpt 503 B

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