BASIC

Author Topic: Little question for Gif File  (Read 1782 times)

Offline Kyo

  • Dr. Type
  • ****
  • Posts: 350
    • View Profile
Little question for Gif File
« on: 2014-Oct-03 »
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  ;)

Offline Ian Price

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 4147
  • On the shoulders of giants.
    • View Profile
    • My Apps
Re: Little question for Gif File
« Reply #1 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.
I came. I saw. I played.

Offline Kyo

  • Dr. Type
  • ****
  • Posts: 350
    • View Profile
Re: Little question for Gif File
« Reply #2 on: 2014-Oct-04 »
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???

Offline Ian Price

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 4147
  • On the shoulders of giants.
    • View Profile
    • My Apps
Re: Little question for Gif File
« Reply #3 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 came. I saw. I played.

Offline Kyo

  • Dr. Type
  • ****
  • Posts: 350
    • View Profile
Re: Little question for Gif File
« Reply #4 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

Offline dreamerman

  • Global Moderator
  • Dr. Type
  • *******
  • Posts: 288
    • View Profile
    • my personal website
Re: Little question for Gif File
« Reply #5 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.
« Last Edit: 2014-Oct-06 by dreamerman »
Check my source code editor for GLBasic - link