Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if file is apng #5

Open
PringlePot opened this issue Jun 21, 2022 · 5 comments
Open

Check if file is apng #5

PringlePot opened this issue Jun 21, 2022 · 5 comments

Comments

@PringlePot
Copy link

It would be nice if theres a simple function to check if a file is actually an apng?

@kettek
Copy link
Owner

kettek commented Jun 22, 2022

This should be possible by creating a new function that only searched to see if the acTL chunk exists. I'll look into the most idiomatic way to present this.

@schainks
Copy link

My 0.02 on this is looking for acTL is the idiomatic way, as it is part of the standard. If the PNG Is animated, acTL chunk must exist: https://wiki.mozilla.org/APNG_Specification#.60acTL.60:_The_Animation_Control_Chunk

@kettek
Copy link
Owner

kettek commented Feb 28, 2024

Would need a helper func to scan only as far as acTL or until first IDAT. We could, as a convenience, return the acTL information if it exists as well. Perhaps vaguely like:

func CheckAPNG() (isAnimation bool, frameCount int, playCount int)

@kettek
Copy link
Owner

kettek commented Feb 28, 2024

It is probably unnecessary to have the above convenience function, as the end-user can actually extract the data if they need more information. I believe isAPNG() bool or isAnimated() bool would suffice.

@schainks
Copy link

This implementation in JS looks like it does what you describe in terms of scanning for the chunk, then returning immediately: https://github.com/qzb/is-animated/blob/master/lib/types/png.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants