Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

APNG inside iOS app

Tags:

ios

apng

I'm probably going to get flamed for this.

I am wondering if anyone know of any way to load APNG (animated PNG) inside an iPhone app?

I'm not talking about multiple PNG image added as an NSArray of UIImages to a UIImageView. I already can do this method but this requires multiple PNG images.

I'm talking about a special PNG format called APNG (http://en.wikipedia.org/wiki/APNG) that only contains 1 PNG file but has animation meta data.

I've found this library called AVAnimator: http://www.modejong.com/AVAnimator/index.html which supposedly can load APNG format but the licence cost $475 USD and the library appears to be from a few years ago (iOS 4).

I also read that Apple iOS 8 Safari as well as Yosemite Safari has built in support for APNG.

I really don't want to resort to using a UIWebView just to display an APNG file. It works, I've tested it but I don't think that's ideal.

I was hoping there is some undiscovered new iOS SDK that lets us load APNG into the app that I'm not aware of and maybe you guys might know.

How does the Line app (http://line.me/en/) do it ? They seem to have animated PNGs for their "stickers".

like image 776
Zhang Avatar asked Apr 24 '15 10:04

Zhang


2 Answers

I found this code,

https://github.com/radif/MSSticker-Images/

you can create a MSSticker APNG with multiply PNG. Maybe you can extract a part of this.

like image 164
Carolina Avatar answered Oct 28 '22 12:10

Carolina


It's really undocumented, but it's somewhere in ImageIO framework.

I can see some APNG strings in CGImageProperties.h

like image 27
maxst Avatar answered Oct 28 '22 12:10

maxst