Bug #14350 Updated: gd cant handle some png files
| From: | edink@php.net | Date: | Fri, 07 Jun 2002 11:43:58 +0000 |
| Subject: | Bug #14350 Updated: gd cant handle some png files | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-9744@lists.php.net to get a copy of this message | ||
ID: 14350
Updated by: edink@php.net
Reported By: martin@humany.com
-Status: Open
+Status: Bogus
Bug Type: GD related
Operating System: win2000
PHP Version: 4.0.6
New Comment:
Thank you for taking the time to report a problem with PHP.
Unfortunately your version of PHP is too old -- the problem
might already be fixed. Please download a new PHP
version from http://www.php.net/downloads.php
If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.
Previous Comments:
------------------------------------------------------------------------
[2002-03-14 07:22:31] aj@haightmail.org
PHP 4.1.2-1
libgd 2.0.1-7
Apache 1.3.23-1
Linux, Debian Woody with libgd package selected from Sid
I experience problems using both ImageCopyResampled and
ImageCopyResized on all PNGs loaded with ImageCreateFromPNG.
Source images that have a transparent background yield an all black
result image, no matter the source and destination sizes. The error is
either in ImageCreateFromPNG or the resize/resample functions, I do not
know which.
Other PNG images yield correct results when the destination size is
smaller than the source size, but generate garbage when the destination
is larger than the source.
JPEGs loaded with ImageCreateFromJpeg, on the other hand, always work.
------------------------------------------------------------------------
[2001-12-05 08:48:42] martin@humany.com
(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 this bug report at http://bugs.php.net/?id=14350&edit=1