GIFs Using Tkinter

G

Gregor Lingl

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top