imageconvolution_basic.phpt 636 B

123456789101112131415161718192021222324252627
  1. --TEST--
  2. Testing 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. $image = imagecreatetruecolor(180, 30);
  11. // Writes the text and apply a gaussian blur on the image
  12. imagestring($image, 5, 10, 8, 'Gaussian Blur Text', 0x00ff00);
  13. $gaussian = array(
  14. array(1.0, 2.0, 1.0),
  15. array(2.0, 4.0, 2.0),
  16. array(1.0, 2.0, 1.0)
  17. );
  18. imageconvolution($image, $gaussian, 16, 0);
  19. include_once __DIR__ . '/func.inc';
  20. test_image_equals_file(__DIR__ . '/imageconvolution_basic.png', $image);
  21. ?>
  22. --EXPECT--
  23. The images are equal.