imageconvolution_error2.phpt 642 B

12345678910111213141516171819202122232425262728
  1. --TEST--
  2. Testing wrong array size 2x3 in imageconvolution() of GD library
  3. --CREDITS--
  4. Guilherme Blanco <guilhermeblanco [at] hotmail [dot] com>
  5. #testfest PHPSP on 2009-06-20
  6. --EXTENSIONS--
  7. gd
  8. --FILE--
  9. <?php
  10. require __DIR__ . '/func.inc';
  11. $image = imagecreatetruecolor(180, 30);
  12. // Writes the text and apply a gaussian blur on the image
  13. imagestring($image, 5, 10, 8, 'Gaussian Blur Text', 0x00ff00);
  14. $gaussian = array(
  15. array(1.0, 2.0, 1.0),
  16. array(2.0, 4.0, 2.0)
  17. );
  18. trycatch_dump(
  19. fn() => imageconvolution($image, $gaussian, 16, 0)
  20. );
  21. ?>
  22. --EXPECT--
  23. !! [ValueError] imageconvolution(): Argument #2 ($matrix) must be a 3x3 array