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

PNGv3 conformance: handling of non-v3 placement of the eXIf chunk #640

Open
jbowler opened this issue Jan 17, 2025 · 0 comments
Open

PNGv3 conformance: handling of non-v3 placement of the eXIf chunk #640

jbowler opened this issue Jan 17, 2025 · 0 comments

Comments

@jbowler
Copy link
Contributor

jbowler commented Jan 17, 2025

At present the PNGv2 and earlier specifications allow eXIf to be placed either before or after IDAT (but not both). libpng allows this but doesn't make "after" easy; for any "after" chunk the authoring app has to create a second png_info and png_write the relevant chunks there.

PNGv3 requires the eXIf to be written before IDAT (see the chunk ordering rules section). Attempts to change the spec have failed so it seems likely it will be so.

Traditionally libpng has issued "diagnostics" when things were done which were detectably outside the spec. The conundrum is that there are now two mutually incompatible spec: PNGv2 (and earlier) vs PNGv3. At best libpng can only offer fatherly advice: Warning PNGv3 requires the eXIf chunk to be written before IDAT. Doing anything more extreme (any error) would break existing apps.

Issuing the warning would either go completely unnoticed or spam command line apps. Since we know ImageMagick and GraphicsMagick both do this and are both command line apps they would be so spammed. Meanwhile other GUI apps would continue their blissful ignorance. That's not something I'm prepared to do but it's obviously an option for other people.

So my suggested solution to this issue, making it a non-issue for libpng, is here:

svgeesus/pngcheck#4 (comment)

Since that seems to be agreed I've entered this as a non-issue to act as a catchall to those who will surely report bugs against libpng saying that it is not reporting this particular "bug".

An alternative approach is to can-the-warnings; don't spam anyone with warnings unless they ask for it. Warnings require consent.

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

1 participant