Playing animated gif files

Getting into LiveCode for iOS? Ask your questions here.

Moderators: heatherlaine, Klaus, FourthWorld, robinmiller, kevinmiller

Post Reply
cmorgan
Posts: 1
Joined: Sun May 20, 2018 3:02 am

Playing animated gif files

Post by cmorgan » Sun May 20, 2018 3:05 am

On the desktop I am able to import an animated gif and play it on a different card using this:

put image "airplane.gif" of card "card2" into card image "imageObject"

This doesn't play the animation in the iOS simulator. Is there another way to do this?

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 2717
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria
Contact:

Re: Playing animated gif files

Post by richmond62 » Thu Jun 14, 2018 12:46 pm

put image "airplane.gif" of card "card2" into card image "imageObject"
I'm not sure what the point of that is.

My inclination would be to check iOS documentation as to how it copes with animated GIF images.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 2717
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria
Contact:

Re: Playing animated gif files

Post by richmond62 » Thu Jun 14, 2018 12:56 pm

http://www.idownloadblog.com/2017/07/14/gifroll/
Users have requested animated GIF support for years, but Apple waited until iOS 11 (Fall of 2017) to finally implement it.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 2717
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria
Contact:

Re: Playing animated gif files

Post by richmond62 » Thu Jun 14, 2018 1:12 pm

Unfortunately, because of storage constraints,
the way that I tend to handle animated GIFS
(in a way that gives full programmatic control over animation)
is probably not worth considering.

Klaus
Posts: 10327
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Playing animated gif files

Post by Klaus » Thu Jun 14, 2018 2:15 pm

Hi cmorgan,

welcome to the forum!
Does the GIF on card "card2" play on card "card2"?

Maybe animated GIFs are really not supported by iOS?
I don't know, I don't develop for mobile nor do I own any mobile device like a cellphone etc.

Hint:
... card image xxx
Is only accepted for HC compatibilty, you do not need to write this in LC anymore!
Just use IMAGE or BUTTON or whatever:
...
put img "airplane.gif" of cd "card2" into img "imageObject"
...


Best

Klaus

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2225
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: Playing animated gif files

Post by jmburnod » Thu Jun 14, 2018 6:11 pm

Hi All,
Possible but very slow (iOS 11.4)
Maybe display a collection of .png would be faster
Best
Jean-Marc

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 2717
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria
Contact:

Re: Playing animated gif files

Post by richmond62 » Fri Jun 15, 2018 11:43 am

Maybe display a collection of .png would be faster
Indeed: If you open an animated GIF in GIMP it is easy (but tedious) to export its frames
as individual images.
-

Code: Select all

on mouseUp
   put 1 into KOUNT
   repeat until KOUNT > 32
      put ("jump" & KOUNT & ".png") into PIK
      set the backGroundPattern of grc "MB" to the ID of img PIK
      add 1 to KOUNT
      wait 3 ticks
   end repeat
end mouseUp
-
jump3.png
jump3.png (15.42 KiB) Viewed 636 times
jump2.png
jump2.png (16.53 KiB) Viewed 636 times
jump1.png
jump1.png (16.46 KiB) Viewed 636 times
-
These stills are extracted from an animated GIF
composed from a sequence of photos by Eadweard Muybridge
that came to 512 KB, as did all the still PNG images:
so NO size overhead, pleasantly enough.

Post Reply

Return to “iOS Deployment”