#20443 [Bgs->Opn]: Jpeg colors change
| From: | tkirby at virginiaartists dot net | Date: | Fri, 15 Nov 2002 21:20:20 +0000 |
| Subject: | #20443 [Bgs->Opn]: Jpeg colors change | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-25011@lists.php.net to get a copy of this message | ||
ID: 20443
User updated by: tkirby@virginiaartists.net
Reported By: tkirby@virginiaartists.net
-Status: Bogus
+Status: Open
Bug Type: GD related
Operating System: Linux
PHP Version: 4.2.3
New Comment:
I have tested it! That's how I know it's a bug. I searched the bug
database and found no references to changed colors in 4.2.3.
This system has a basic problem: just because something is "fixed" in
CVS does not mean the problem is solved by any means. Why are buggy
versions of php released at all?
Previous Comments:
------------------------------------------------------------------------
[2002-11-15 13:39:40] sniper@php.net
Why do you report if you can't test? And this is already fixed btw..
------------------------------------------------------------------------
[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