GIF bug

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

GIF bug

Leo Barnes

I have found a bug in how PIL handles animated GIFs. The GIF in
question contains several frames, where each new frame only overwrites
parts of the previous frame. Unless I explicitly ask PIL to load/show
each frame, PIL completely skips previous frames which means that the
extracted image will contain uninitialized data.

Steps to reproduce:

#Will show uninitialized data
from PIL import Image
i ="image0006.gif")
j = i.convert("RGBA")

#Seems to fix problem with uninitialized data by forcing PIL to load
the previous frame
#(Works most of the time, but does not seem completely reliable. The
image buffer is probably uninitialized and #simply reused which can
work if lucky.)
from PIL import Image
i ="image0006.gif")
j = i.convert("RGBA")

Best regards,
Image-SIG maillist  -  [hidden email]