-1

I have the following problem. I generate .GIF files using an external application. To me the GIFs look fine, I can open them without problems. However, using

        photo = PhotoImage(file=screenshot_file)
        self.previewImageLabel.config(image=photo)
        self.previewImageLabel.image = photo

to add an image to a Tkinter Label, is giving me the following error:

TclError: couldn't recognize data in image file "C:\Users\D8W\Python\hoang\combi ne_model_neu\test_bauteile\SQTR-VO\prev_F45_SQTR.GIF"

The thing is, when I upload one of the GIFs to some online Converter and convert them to "GIF", they get displayed perfectly fine. So my external application, which generates the GIFs, is putting something in there that Tkinter doesn't like.

How can I modify the GIFs to work? What are alternatives solving this problem? I may not use modules that are not included in Python(like PIL).

Do you have any ideas? Thanks in advance

Doc
  • 345
  • 4
  • 17
  • Are you sure the image is in proper gif format? Renaming files from .jpg/.png to .gif makes files that look alright, but aren't really gif format. – fhdrsdg Feb 26 '15 at 11:18
  • Solved it, but do you have any idea how I can adjust the size to my Label without using PIL? – Doc Feb 26 '15 at 11:34
  • That's a completely different question, if you want an answer to that, please ask a new question. – fhdrsdg Feb 26 '15 at 12:30

1 Answers1

1

I solved it, the problem was within my external application. I specified the file as .GIF but I have set the type to PNG.

Thanks anyway

Doc
  • 345
  • 4
  • 17