xref: /PHP-7.3/ext/gd/tests/bug39273.phpt (revision ded3d984)
1--TEST--
2Bug #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);
11imagecolortransparent($small, 0);
12imagealphablending($small, 0);
13imagefilledrectangle($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
22imagecolortransparent($img, 0);
23imagealphablending($img, false);
24imagecopyresized($img, $small, 0,0, 0,0, $width, $height, $srcw, $srch);
25imagesavealpha($img, 1);
26
27$c = imagecolorat($img, 0,0);
28printf("%X", $c);
29?>
30--EXPECT--
3132FF0000
32