GIF bug
Leo Barnes <[email protected]> Tue, 27 Mar 2012 15:59:37 +0200
| Newsgroups | gmane.comp.python.image |
|---|---|
| Message-ID | <CAAeLMUjojm6mF0SJiUDG0zGkbOG21vZTohCX+BTh37wyTjOvWg@mail.gmail.com> |
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 - [email protected]
http://mail.python.org/mailman/listinfo/image-sig