imageconvolution_error3.phpt 675 B

123456789101112131415161718192021222324252627
  1. --TEST--
  2. Testing wrong array size 3x2 in imageconvolution() of GD library
  3. --CREDITS--
  4. Guilherme Blanco <guilhermeblanco [at] hotmail [dot] com>
  5. #testfest PHPSP on 2009-06-20
  6. --SKIPIF--
  7. <?php
  8. if (!extension_loaded("gd")) die("skip GD not present");
  9. ?>
  10. --FILE--
  11. <?php
  12. $image = imagecreatetruecolor(180, 30);
  13. // Writes the text and apply a gaussian blur on the image
  14. imagestring($image, 5, 10, 8, 'Gaussian Blur Text', 0x00ff00);
  15. $gaussian = array(
  16. array(1.0, 2.0, 1.0),
  17. array(2.0, 4.0, 2.0),
  18. array(1.0, 2.0)
  19. );
  20. var_dump(imageconvolution($image, $gaussian, 16, 0));
  21. ?>
  22. --EXPECTF--
  23. Warning: imageconvolution(): You must have 3x3 array in %s on line %d
  24. bool(false)