note 13743 added to function.imagejpeg.php
| From: | steve at stevegodwin dot com | Date: | Sat, 30 Jun 2001 21:32:04 +0000 |
| Subject: | note 13743 added to function.imagejpeg.php | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-14829@lists.php.net to get a copy of this message | ||
Regarding JPEG color shifts in GD 2.0.1:
They added the ImageCreateTrueColor function to create image resources with unlimited color
palettes. In the process, they must have also changed ImageCreate[FromJPEG,etc] so that it returns
only a 256 color palette. The old version of ImageCreate worked fine with true color images.
I did this as a workaround and it seemed to give me accurate colors:
$src_im = ImageCreateFromJPEG("filename.jpg");
$dst_im = ImageCreateTrueColor( $dst_width, $dst_height );
ImageCopy( $dst_im, $src_im, 0, 0, 0, 0, $src_width, $src_height);
ImageJPEG( $dst_im, $dst_img_name);
--sdg--
http://www.php.net/manual/en/function.imagejpeg.php