#39353 [Bgs]: more imagecopyresized() alpha problems
| From: | pajoye@php.net | Date: | Sat, 04 Nov 2006 19:21:46 +0000 |
| Subject: | #39353 [Bgs]: more imagecopyresized() alpha problems | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-104416@lists.php.net to get a copy of this message | ||
ID: 39353
Updated by: pajoye@php.net
Reported By: seth at pricepages dot org
Status: Bogus
Bug Type: GD related
Operating System: Mac 10.4
PHP Version: 5CVS-2006-11-02 (snap)
Assigned To: pajoye
New Comment:
"That is a workaround. imagecopyresized() isn't working as
defined in the manual, so you've changed the destination
image to compensate."
Now you've reached my patience limit.
http://blog.thepimp.net/misc/bug39353_with_alpha.png
is exactly what you expect.
Now if you do not understand the different between the TRANSPARENT
COLOR and the alpha channel of each independent pixel, I cannot help
you further.
But you keep considering other apps behaviors as what should happen in
gd. It is not the case for various reasons (backward compatibility is
one of them).
"But I've seen worse code in the GD library..."
For example?
Previous Comments:
------------------------------------------------------------------------
[2006-11-04 19:16:05] seth at pricepages dot org
That is a workaround. imagecopyresized() isn't working as
defined in the manual, so you've changed the destination
image to compensate.
I suppose it's fine if you don't want to fix it, I think I
can use this workaround for now.
There is a waste of pixel processing, though. You need to
process the entire final image twice. But I've seen worse
code in the GD library...
------------------------------------------------------------------------
[2006-11-04 18:59:26] pajoye@php.net
$img = imagecreatetruecolor($width, $height);
$bgdalpha = imagecolorallocatealpha($img,0,0,0, 127);
imagefill($img, 0,0, $bgdalpha);
imagecopyresized($img, $small, 0,0, 0,0, $width, $height,
$srcW,$srcH);
imagesavealpha($img, 1);
imagepng($img, 'a.png');
------------------------------------------------------------------------
[2006-11-04 18:10:10] seth at pricepages dot org
But I *still* can't produce the image that I want. I simply
want to enlarge $small. How can I do this?
------------------------------------------------------------------------
[2006-11-04 17:50:39] pajoye@php.net
"Shouldn't it be default?"
Backward compatibility... GD is an old library. But things are getting
better.
No bug > bogus.
------------------------------------------------------------------------
[2006-11-04 17:48:46] seth at pricepages dot org
Oh! No, I didn't realize imagesavealpha() existed. Why is
saving the alpha a separate function? Shouldn't it be default?
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/39353
--
Edit this bug report at http://bugs.php.net/?id=39353&edit=1