From:             don at seiler dot us
Operating system: gentoo linux 2.4.20
PHP version:      4.3.0
PHP Bug Type:     GD related
Bug description:  resizing png images results not working

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 bug report at http://bugs.php.net/?id=22388&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=22388&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=22388&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=22388&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=22388&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=22388&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=22388&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=22388&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=22388&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=22388&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=22388&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22388&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=22388&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=22388&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=22388&r=gnused

Reply via email to