Little question for Gif File

Previous topic - Next topic

Kyo

GL_B support Animated Gif?

I found this http://www.glbasic.com/forum/index.php?topic=8472.msg71729#msg71729
but not work on Android (i not test on iphone).

Gif is great for create animated presentation (example for Logo).

Thanks for help  ;)

Ian Price

What you can do is rip the GIF animation into a strip (there are online tools for this - I used such a tool recently, with acceptable results), and display with DRAWNIM. Not exactly GIF support for mobiles etc. but guaranteed to work.
I came. I saw. I played.

Kyo

Quote from: Ian Price on 2014-Oct-03
What you can do is rip the GIF animation into a strip (there are online tools for this - I used such a tool recently, with acceptable results), and display with DRAWNIM. Not exactly GIF support for mobiles etc. but guaranteed to work.
It's great idea, but what is the maximum size supported? 2048x2048???

Ian Price

Depends on the hardware, but I wouldn't go any larger than that (2048x2048). You can also use multiple anim strips if the animation is too large. You can also use online tools to scale the anim down too.

Have you looked into why that GIF routine is failing on Android devices? Are you sure the GIF is being found?
I came. I saw. I played.

Kyo

Quote from: Ian Price on 2014-Oct-04
Depends on the hardware, but I wouldn't go any larger than that (2048x2048). You can also use multiple anim strips if the animation is too large. You can also use online tools to scale the anim down too.

Have you looked into why that GIF routine is failing on Android devices? Are you sure the GIF is being found?
I think .... have used a large stip gif (4096x4096) tomorrow I test 2048x2848 .....  :S

dreamerman

#5
That GIF loading code should work on mobiles, I have tested it on my cheap android tablet without problems, soon I will update that topic with full GLB gif loading code (no inline). Still if you trying to load such big gif animation, edit code, there are: gif_max_sprite_width% and ..._heght% change them to higher values, maybe this will help. What error code are you getting from gif loader?
Max texture size may be limited by your hardware, don't know what devices you target but using such big textures isn't best idea, maybe some optimization? Cut only really animated part, or strip one animation in 2 gif-s so they would require much smaller files.

Edit: Furthermore, gif decoding takes some time (it decodes gif, and creates glb sprite that can be used with DRAW_SPRITE/ANIM / Polyvector cmds), so it's best to use it with small files (e.g. like web/ad banners). Best (for such big gif) way would be convert that gif animation on pc to one png/jpg file, load it in GLB and use DRAW_ANIM or custom animation code.
Check my source code editor for GLBasic - link Update: 20.04.2020