php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20443 Jpeg colors change
Submitted: 2002-11-15 04:20 UTC Modified: 2002-11-15 15:42 UTC
From: tkirby at virginiaartists dot net Assigned:
Status: Closed Package: GD related
PHP Version: 4.2.3 OS: Linux
Private report: No CVE-ID: None
 [2002-11-15 04:20 UTC] tkirby at virginiaartists dot 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);




Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-11-15 09:11 UTC] 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 13:34 UTC] tkirby at virginiaartists dot 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 13:39 UTC] sniper@php.net
Why do you report if you can't test? And this is already fixed btw..

 [2002-11-15 15:20 UTC] tkirby at virginiaartists dot net
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?
 [2002-11-15 15:24 UTC] derick@php.net
If you think that software without bugs exist, please show me one. Now, if you report a bug in some product, it is quite normal that the developers ask you retest a newer version from which _we_ (yes, the guys writing your software for free) think it's fixed. If you're not willing to do that it's not our problem.

Have a nice day.

Derick
 [2002-11-15 15:42 UTC] tkirby at virginiaartists dot net
Derick,

It's not a matter of what I'm willing to do. It's a matter of what a large percentage of users are able to do. I have no control over what version of PHP is installed on my server. From what I hear, that applies to 40-60 % of
all site developers on the net.

I don't think the fact that php is free is relavant to whether it is released with or without major bugs. It's a quality issue. (e.g. If it's worth doing, it's worth doing well.) Sure, it's wonderfull and truly fullfilling that php is available for free. But it's free to my ISP, not to
me. I'm paying through the nose to use it.

I've been using php extensively through at least two updates. This is the first one that broke critical core functions and caused failures on my site. I think I am justifiably annoyed.

BTW - the classification of a bug report as "Bogus" is not a very polite terminology. It implies that a) I am a fool, and b) perhaps I just made it up for fun.

Bogus to you too!
Have wonderfull weekend!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 19 16:01:31 2024 UTC