#20443 [Opn->Bgs]: Jpeg colors change
| From: | sniper@php.net | Date: | Fri, 15 Nov 2002 19:39:40 +0000 |
| Subject: | #20443 [Opn->Bgs]: Jpeg colors change | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-25006@lists.php.net to get a copy of this message | ||
ID: 20443
Updated by: sniper@php.net
Reported By: tkirby@virginiaartists.net
-Status: Open
+Status: Bogus
Bug Type: GD related
Operating System: Linux
PHP Version: 4.2.3
New Comment:
Why do you report if you can't test? And this is already fixed btw..
Previous Comments:
------------------------------------------------------------------------
[2002-11-15 13:34:59] tkirby@virginiaartists.net
Due to ISP limitations, CVS is not an option.
Does anyone know exactly where this bug resides? Must be in the GD, but
is it in all the copy/resize functions? Any work-arounds?
Thanks!
------------------------------------------------------------------------
[2002-11-15 09:11:07] sniper@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php4-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-latest.zip
------------------------------------------------------------------------
[2002-11-15 04:20:02] tkirby@virginiaartists.net
Resized images generated from jpg files displaying botched or dimmed
colors after update from 4.2.2 to 4.2.3.
Example code:
# get the data from the original, large image
$src_img = ImageCreateFromJPEG($image);
# create new image
$dst_img = ImageCreate($new_w,$new_h);
# allocate colors for background and border
$mattecolor = ImageColorAllocate($dst_img,$mr,$mg,$mb);
$bordercolor = ImageColorAllocate($dst_img,$br,$bg,$bb);
# fill image with matte color
ImageFill($dst_img,0,0,$mattecolor);
# resize source image and place the copy in the destination image
ImageCopyResized($dst_img,$src_img,
$margin_x,$margin_y,
0,0,$thumb_w,$thumb_h,
$old_x,$old_y);
# if there is a border set, draw a rectangle around the thumbnail
if
($border==1){imageRectangle($dst_img,0,0,$new_w-1,$new_h-1,$bordercolor);}
# create final image and free up the memory
ImageJPEG($dst_img);
ImageDestroy($dst_img);
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=20443&edit=1