From:             [EMAIL PROTECTED]
Operating system: win2000
PHP version:      4.0.6
PHP Bug Type:     GD related
Bug description:  gd cant handle some png files

(Im using the official php 4.0.6 build for windows from php.net, only
extension loaded is php_imap.dll).
I've written a function to rezise images (used for making thumbnails), it's
working fine, also with png-files, but not all. Below is the code to
reproduce the problem:


jul.png is working properly, download from http://inthc.net/jul.png

gba_large.png is NOT working properly, download from
http://inthc.net/gba_large.png

(gba_large.png result in a full blue window, or a full black or gray, it
changes upon reload..)
gba_large.png was created with Paint Shop Pro 7, and displays fine in IE,
Netscape & Opera.

----snip start--
//$filename = "jul.png";
$filename = "gba_large.png";

$inImg = @ImageCreateFromPNG($filename);
if (!$inImg) { echo "Failed to open png!"; die; }

$size = GetImageSize($filename);
$srcW = $size[0]; $srcH = $size[1];
$dstW = 100; $dstH = 100;
$outImg = @ImageCreate($dstW, $dstH);
ImageCopyResampled($outImg, $inImg, 0,0,0,0, $dstW, $dstH, $srcW, $srcH);
                
header("Content-type: image/x-png");
ImagePNG($outImg);
---snip end--
-- 
Edit bug report at: http://bugs.php.net/?id=14350&edit=1


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to