kivy / kivy-ios

Toolchain for compiling Python / Kivy / other libraries for iOS
https://kivy.org/docs/guide/packaging-ios.html
MIT License
777 stars 240 forks source link

Gif Images #690

Closed garantor closed 2 years ago

garantor commented 2 years ago

Versions

Describe the bug .gif image not running on Iphone, works fine when on mac

Logs


[INFO   ] [Video       ] Provider: null(['video_ffmpeg', 'video_ffpyplayer'] ignored)
[INFO   ] [GL          ] NPOT texture support is available
 Traceback (most recent call last):
   File "/Users/afolabi/projects/ios_main/sentit-ios/YourApp/main.py", line 140, in <module>
   File "/private/var/containers/Bundle/Application/CF628AFC-E5B5-40E0-BCA6-B9FC1193C61E/sentit.app/lib/python3.9/site-packages/kivy/app.py", line 949, in run
     self._run_prepare()
   File "/private/var/containers/Bundle/Application/CF628AFC-E5B5-40E0-BCA6-B9FC1193C61E/sentit.app/lib/python3.9/site-packages/kivy/app.py", line 919, in _run_prepare
     root = self.build()
   File "/Users/afolabi/projects/ios_main/sentit-ios/YourApp/main.py", line 79, in build
   File "/private/var/containers/Bundle/Application/CF628AFC-E5B5-40E0-BCA6-B9FC1193C61E/sentit.app/lib/python3.9/site-packages/kivy/loader.py", line 195, in _set_loading_image
     self._loading_image = ImageLoader.load(filename=image)
   File "/private/var/containers/Bundle/Application/CF628AFC-E5B5-40E0-BCA6-B9FC1193C61E/sentit.app/lib/python3.9/site-packages/kivy/core/image/__init__.py", line 463, in load
     raise Exception('Unknown <%s> type, no loader found.' % ext)
 Exception: Unknown <gif> type, no loader found.
2022-03-22 13:01:38.970272+0100 sentit[13283:5008822] Application quit abnormally!
2022-03-22 13:01:39.017376+0100 sentit[13283:5008822] Leaving

Screenshots

Screenshot 2022-03-22 at 13 10 57

Additional context Add any other context about the problem here.

RobertFlatt commented 2 years ago

FYI This is I think similar to the issue I have seen with core.camera where the camera provider is hidden by the kivy-ios libkivy.a name space and the dynamic loader can't find it. In that case I was able to work around by patching the dynamic loader with a static import statement. https://github.com/RobertFlatt/kivy-ios/blob/master/kivy_ios/recipes/kivy/kivy_core_camera.patch As such it looks to me like a kivy-ios design issue.

In this case it is probably the library register https://github.com/kivy/kivy/blob/master/kivy/core/image/__init__.py#L992 that fails for the same namespace reason.

I assume the potential cases are

0000000000000000 T _PyInit_kivy_core_audio_audio_sdl2
0000000000000000 T _PyInit_kivy_core_camera_camera_avfoundation
0000000000000000 T _PyInit_kivy_core_clipboard__clipboard_sdl2
0000000000000000 T _PyInit_kivy_core_image__img_sdl2
0000000000000000 T _PyInit_kivy_core_image_img_imageio
0000000000000000 T _PyInit_kivy_core_text__text_sdl2
0000000000000000 T _PyInit_kivy_core_text_text_layout
garantor commented 2 years ago

thanks, @RobertFlatt i was able to solve this issue by specifying pil and sdl at the top of my main file as KIVY_IMAGE. something like this,

import os
os.environ['KIVY_IMAGE'] = 'pil,sdl2'

and the above works fine