Quantcast

GIF bug

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

GIF bug

Leo Barnes
Hi!

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:
Image: http://dl.dropbox.com/u/14498565/image0006.gif

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

#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 = Image.open("image0006.gif")
i.load()
i.seek(1)
j = i.convert("RGBA")
j.show()

Best regards,
//Leo
_______________________________________________
Image-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/image-sig
Loading...