6.x-1.3 doesn't work correctly when resizing GIF images that contain transparent pixels.

6.x-1.2 worked fine, and therefore I'm left wondering why the imagealphablending and imagesavealpha functions are now used for all images and not just for PNGs (also see issue #355242). :3

Here's a test case:

http://i43.tinypic.com/beep2r.gif (Original transparent GIF image)
http://i41.tinypic.com/ngrn1d.gif (Scaled down to 150x150 using imageapi 6.x-1.3)
http://i44.tinypic.com/5zmw6s.gif (Scaled down to 150x150 using imageapi 6.x-1.3 with the attached patch applied)


foutrelis’s picture

Issue linking fail. Here's a correct link: #355242: Transparency fixes for imageapi - GD

theonetruedevo’s picture

923 bytes

I'm having the same problem with gifs, but applying the patch gives me the same broken but still transparent image as the previous version of imageapi.

drewish’s picture

we've got some good code that's been committed to D7 HEAD that needs to be backported. once it's all in HEAD i'll work on this.

dman’s picture

subscribe (sorry no time now, but I'll see next time I'l playing with trans :( )

drewish’s picture

Status: Active » Fixed

I committed #396924: Backport fixes from D7 core which should help with this. If not please re-open this issue.

dman’s picture

I just did a big round of testing (and subsequent changes to my imagecache actions) and it seems like todays D6 dev is looking really good for transparencies.
Still a small issue with gifs on resize - as you can see in the third row. That happens because a gif with #FFFFFF and #FFFFFF+Alpha is a legal gif (those are two different indexed colors) but when the image gets copied to a new resource, that becomes : (both are white, and white is transparent)
Often we can work around that by using an off-white (or "that pink") to be the transparent color (row 4) - but that has unpleasant results.

Still, mostly good. Gifs are not very popular targets for imagecache ... I imagine?
Not re-opening, it's fixed enough until I can really find a need to push it harder.

drewish’s picture

i'd be all for fixing this but at this point we need to corrdinate the fix with core so that it and imageapi stay consistent. make sure you ping me when you open a new issue.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

yang_yi_cn’s picture

Version: 6.x-1.3 » 6.x-1.10
Status: Closed (fixed) » Needs review
595 bytes

I meet some problem with GD & scaled gif images today.

After some research, I found that post http://www.letsgeek.com/code/resize-transparent-gif-in-gd-php/ , which mentioned that you have to use imagecreate() instead of imagecreatetruecolor() for gif images, to make the transparency work correctly.

And it works for me. The patch is being attached.

yang_yi_cn’s picture

1.05 KB
1.68 KB
2.82 KB

also my images are attached:

Origin / before patch / after patch