GLBasic forum

Main forum => GLBasic - en => Topic started by: Kyo on 2014-Oct-03

Title: Little question for Gif File
Post by: Kyo on 2014-Oct-03
GL_B support Animated Gif?

I found this http://www.glbasic.com/forum/index.php?topic=8472.msg71729#msg71729 (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  ;)
Title: Re: Little question for Gif File
Post by: 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.
Title: Re: Little question for Gif File
Post by: Kyo on 2014-Oct-04
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???
Title: Re: Little question for Gif File
Post by: 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?
Title: Re: Little question for Gif File
Post by: Kyo on 2014-Oct-04
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
Title: Re: Little question for Gif File
Post by: dreamerman on 2014-Oct-06
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.