why can not load gif format file as Image source?

672 views
Skip to first unread message

Simon

unread,
Sep 9, 2017, 5:37:17 AM9/9/17
to Kivy users support
I download the gif from http://www.animatedimages.org/img-animated-button-image-0575-88979.htm, I also attached it here.

my code is simple

from kivy.lang import Builder
from kivy.app import runTouchApp

runTouchApp(Builder.load_string(
'''
Image:
source:'animated-button-image-0575.gif'
'''
))

the error log is

C:\Python27\python.exe D:/123/effect.py
[INFO ] [Logger ] Record log in C:\Users\Administrator\.kivy\logs\kivy_17-09-09_50.txt
[INFO ] [Kivy ] v1.10.0
[INFO ] [Python ] v2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit (Intel)]
[INFO ] [Factory ] 194 symbols loaded
[INFO ] [Image ] Providers: img_tex, img_dds, img_sdl2, img_pil, img_gif (img_ffpyplayer ignored)
[INFO ] [OSC ] using <thread> for socket
[INFO ] [Window ] Provider: sdl2
[INFO ] [GL ] Using the "OpenGL" graphics system
[INFO ] [GL ] GLEW initialization succeeded
[INFO ] [GL ] Backend used <glew>
[INFO ] [GL ] OpenGL version <4.0.0 - Build 9.17.10.2932>
[INFO ] [GL ] OpenGL vendor <Intel>
[INFO ] [GL ] OpenGL renderer <Intel(R) HD Graphics>
[INFO ] [GL ] OpenGL parsed version: 4, 0
[INFO ] [GL ] Shading version <4.00 - Build 9.17.10.2932>
[INFO ] [GL ] Texture max size <8192>
[INFO ] [GL ] Texture max units <16>
[INFO ] [Shader ] fragment shader: <No errors.>
[INFO ] [Shader ] vertex shader: <No errors.>
[INFO ] [Shader ] program: <No errors.>
[INFO ] [Window ] auto add sdl2 input provider
[INFO ] [Window ] virtual keyboard not allowed, single mode, not docked
[ERROR ] [Image ] Error loading texture animated-button-image-0575.gif
[INFO ] [Base ] Start application main loop
[INFO ] [Base ] Leaving application in progress..


I am wondering why error message here, the gif file is ok, at least it seemed ok.
How to solve this problem. thanks in advance.

animated-button-image-0575.gif

Simon

unread,
Sep 9, 2017, 8:30:23 AM9/9/17
to Kivy users support
I solve the problem, though I still do not know why...

my code is

import os
os.environ['KIVY_IMAGE'] = 'sdl2,gif'
import kivy
from kivy.app import runTouchApp
from kivy.lang import Builder



runTouchApp(Builder.load_string(
'''
Image:
source:'animated-button-image-0575.gif'
'''
))

in fact, I do not know why, I just can not put 'pil' in 
os.environ['KIVY_IMAGE'] = 'sdl2,gif'

and also after this , I have to add

import kivy

to make the config work :)



Reply all
Reply to author
Forward
0 new messages