Resize of Image when preserve_transparency = true

See all posts Reply

Resize of Image when preserve_transparency = true new!
by Horst, 17 years, 5 months ago
have updated from 0.19 to 0.24
now the resizing of GIF's won't work correct for me when preserve_transparency is set to true: the Image itself will be resized, but in a Image of the Original Size

Sample. Original Size is 567 x 403 px
after resizing I get a Image with the same Size with a little Image inside

Original: http://sdfiles.serveftp.net/picture/original.gif

Resized with transparency=true: http://sdfiles.serveftp.net/picture/resized1.gif
and with false: http://sdfiles.serveftp.net/picture/resized2.gif

with old Version it worked properly

what do I miss ?

thanx HorstReply
Re: Resize of Image when preserve_transparency = true new!
by colin, 17 years, 5 months ago
Yes, there is an issue with transparency in the latest version.

I am working on it at the moment, and hope to release something soon. I don't have much time right now, so... I don't know when it will be ready.

Thank you for your samples and tests, it will be useful.Reply
Re: Resize of Image when preserve_transparency = true new!
by colin, 17 years, 5 months ago
Actually, can you paste here the code that you use?Reply
Re: Resize of Image when preserve_transparency = true new!
by Horst, 17 years, 5 months ago
here it is

$image = new Upload($cms_image["image_dir"].$cms_image["image_name"]);
$image->preserve_transparency    = false;
$image->image_resize                     = true;
$image->image_ratio_y                    = true;
$image->image_x  = $cms_image["max_width"]; //100
$image->image_convert  = strtolower($cms_image["target_ext"]);
$image->jpeg_quality  = $cms_image["jpg_quality"]; //75
$image->file_new_name_body = $cms_image["thumb_name1"];
$image->Process($cms_image["thumb_dir"]);

where some Values comes out of my CMS, but think that they are valid - all other Variables are 'Default'Reply
Re: Resize of Image when preserve_transparency = true new!
by colin, 17 years, 5 months ago
I fixed the bug, at least on my development version. There is a bug in the code which converts palette images to true color.

Before I can release the new version, as a quick fix, you can comment out the block of code just under the following line:
// if the image has a palette (GIF), we convert it to true color, preserving transparency
Reply
Re: Resize of Image when preserve_transparency = true new!
by Horst, 17 years, 5 months ago
Hi

for now I did a downgrade to old Version :(
cause with the 'Patch' I got reduced Colors in the Images.
I'll wait for the next Release - thanx for your SupportReply
Re: Resize of Image when preserve_transparency = true new!
by colin, 17 years, 5 months ago
I am working on a new version, with plenty of new features, but also a stronger support for transparent images.

Sorry about the inconvenience. The new release will be done ASAP, but I am lacking of time at the moment.Reply
Re: Resize of Image when preserve_transparency = true new!
by Vesselin Petrunov, 17 years, 3 months ago
Hello, i have the same problem - fortunately when i commented the piece of code as pointed above it worked.

sehr goodie :) i love you for writing such a complete classReply
Re: Resize of Image when preserve_transparency = true new!
by colin, 17 years, 3 months ago
Thank you.

Try to use the 0.25 RC1, that you can find here. It is far better when dealing with transparent images.

If you have any problem with 0.25, let me know, so I can fix it before the official release.Reply