[Tutor] GIFs Using Tkinter

Gregor Lingl glingl at aon.at
Mon Sep 8 15:03:45 EDT 2003


Hi all!

I'm trying to use recipe 9.5 from Python Cookbook, which suggests
to read gifs from files using base64.encodestring in order to embed 
those images into my sourcecode.

I've prepared some 20 gifs with Photoshop which are all merely
rotated versions of some "master"-gif. (They all are produced in
exactly the same way and have (255,255,255) as transparent color.)

They all can be used as Tkinter PhotoImages with the file-option
perfectly well.

However, if I try to use the data-option with strings constructed
from those same gifs according to the recipe mentioned above,
I observe, that among those gif-images
(1) some can be displayed correctly (more than 50%)
(2) some are corrupted and are displayed with stripes or other
artefacts.
(3) and some result in strings only a few characters long
which cannot be interpreted as image-data at all.

What could be the reason for this annoying behaviour and how
can I avoid it.

Thanks in advance

Gregor





More information about the Tutor mailing list