Annotation of embedaddon/php/ext/gd/tests/bug39273.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #37360 (gdimagecreatefromgif, bad image sizes)
! 3: --SKIPIF--
! 4: <?php
! 5: if (!extension_loaded('gd')) die("skip gd extension not available\n");
! 6: ?>
! 7: --FILE--
! 8: <?php
! 9: $small = imagecreatetruecolor(10, 10);
! 10: $c1 = imagecolorallocatealpha($small, 255,0,0,50);
! 11: imagecolortransparent($small, 0);
! 12: imagealphablending($small, 0);
! 13: imagefilledrectangle($small, 0,0, 6,6, $c1);
! 14:
! 15: $width = 300;
! 16: $height = 300;
! 17: $srcw = imagesx($small);
! 18: $srch = imagesy($small);
! 19:
! 20: $img = imagecreatetruecolor($width, $height);
! 21:
! 22: imagecolortransparent($img, 0);
! 23: imagealphablending($img, false);
! 24: imagecopyresized($img, $small, 0,0, 0,0, $width, $height, $srcw, $srch);
! 25: imagesavealpha($img, 1);
! 26:
! 27: $c = imagecolorat($img, 0,0);
! 28: printf("%X", $c);
! 29: ?>
! 30: --EXPECTF--
! 31: 32FF0000
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>