#22388 [Opn->Fbk]: resizing png images results not working
| From: | iliaa@php.net | Date: | Mon, 24 Feb 2003 02:07:00 +0000 |
| Subject: | #22388 [Opn->Fbk]: resizing png images results not working | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-34042@lists.php.net to get a copy of this message | ||
ID: 22388
Updated by: iliaa@php.net
Reported By: don at seiler dot us
-Status: Open
+Status: Feedback
Bug Type: GD related
Operating System: gentoo linux 2.4.20
PHP Version: 4.3.0
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
I've tried your test script with latest CVS and it works fine.
If the problem persists please indicate which GD are you using
(built-in or native) as well as what version of libpng your php/gd are
linked against?
Previous Comments:
------------------------------------------------------------------------
[2003-02-23 19:10:21] don at seiler dot us
Just noting that it does resize jpeg images just fine.
------------------------------------------------------------------------
[2003-02-23 19:09:15] don at seiler dot us
mod_php 4.3.x is failing to properly resize a png image. It outputs no
errors but the resulting image is just a single color, which obviously
would be nothing like the original photograph.
My code works perfectly fine on mod_php 4.2.3 with the gd patch.
here is the code I use for png resizing, I actually output to a new
image, basically thumbnail creation.
$orig_image = "/path/to/orig_image.png";
$thumb_image = "/path/to/thumb_image.png";
/* code to get image dimensions and thumb image dimensions here */
$src_image = imagecreatefrompng($orig_image);
$dst_image = imagecreate($dst_width, $dst_height);
imagecopyresized($dst_image, $src_image, 0, 0, 0, 0, $dst_width,
$dst_height, $src_width, $src_height);
imagepng($dst_image, $thumb_image);
imagedestroy($src_image);
imagedestroy($dst_image);
As I said this code behaves fine on 4.2.3. On 4.3.0 and 4.3.1 it
outputs a single-color image/png file.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=22388&edit=1