Can I programmatically determine if a PNG is animated?

I have PNG (as well as JPEG) images uploaded to my site.

They should be static (i.e. one frame).

There is such thing as APNG.

Bouncy ball

(it will be animated in Firefox).

According to the Wikipedia article...

APNG hides the subsequent frames in PNG ancillary chunks in such a way that APNG-unaware applications would ignore them, but there are otherwise no changes to the format to allow software to distinguish between animated and non-animated images.

Does this mean it is impossible to determine if a PNG is animated with code?

If it is possible, can you please point me in the right direction PHP wise (GD, ImageMagick)?

13
задан Cœur 2 November 2018 в 12:19
поделиться