I suspect that if you do an "imagecopyresampled" or somesuch into a
fresh NEW image, you'd get what you want.

Not saying you haven't found a bug ; Just suggesting a work-around.

On Fri, December 1, 2006 4:26 pm, Graham Anderson wrote:
> Is there some trick to getting PHP GD to properly convert a 24bit PNG
> [with alpha]  into a JPEG without garbling the image output?
>
> The below will output the jpg image, but it appears that the alpha
> channel from the original png  is garbling the jpeg a bit
> To no avail, I tried setting imageAlphaBlending and imageSaveAlpha to
> 'false' and 'true'
> I also tried setting the jpeg quality to 90 and 100.
>
> $image_output = "myimage.jpeg";
> $image = imagecreatefrompng($original_24bit_png_image);
>
> imageAlphaBlending($image, true);
> imageSaveAlpha($image, true);
>
> header("Content-type: image/jpeg");
> imagejpeg($image,'',100);
> imagedestroy($image);
>
>
> many thanks in advance
> g
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to