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

Add support for APNG #215

Merged
merged 1 commit into from
Jun 12, 2019
Merged

Add support for APNG #215

merged 1 commit into from
Jun 12, 2019

Conversation

oss6
Copy link
Contributor

@oss6 oss6 commented May 26, 2019

Summary

Description

The signature of an APNG file is the same as the PNG one.

To be recognized as an APNG, an acTL chunk must appear in the stream before any IDAT chunks - https://wiki.mozilla.org/APNG_Specification

A solution is to check from the end of the IHDR chunk to the first IDAT chunk: if we find an acTL definition in between (61 63 54 4C) then we return APNG.

Note - A PNG/APNG chunk has the following structure: Length (4 bytes) | Chunk type (4 bytes) | Chunk data (length bytes) | CRC (4 bytes) (https://en.wikipedia.org/wiki/APNG).

Notes

Thank you very much!

@sindresorhus sindresorhus merged commit 17e9c5f into sindresorhus:master Jun 12, 2019
@styfle styfle mentioned this pull request Oct 31, 2024
2 tasks
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

Successfully merging this pull request may close these issues.

APNG support
2 participants