note 13743 deleted from function.imagejpeg by jimw
| From: | jimw@php.net | Date: | Thu, 20 Dec 2001 20:33:37 +0000 |
| Subject: | note 13743 deleted from function.imagejpeg by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-23399@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--