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

Define some amount of error handling behavior #150

Closed
ProgramMax opened this issue Jul 25, 2022 · 2 comments
Closed

Define some amount of error handling behavior #150

ProgramMax opened this issue Jul 25, 2022 · 2 comments

Comments

@ProgramMax
Copy link
Collaborator

There are a number of issues which have come up where different decoders handle error conditions differently. For example, #96 and #29.

We should discuss whether to specify some degree of error handling behavior and what it should be.

For example, an error while parsing a critical chunk might block decoding the image. This should then be treated as an error with the whole image. However, an error while parsing a tEXt chunk can perhaps be ignored and the image can still be decoded and displayed.

This could get tricky, though. One of the tEXt chunk keywords is "Warning" for cases where the user might want to be warned about the nature of the image before viewing it. For example, maybe the image contains violence. If we ignore an erroring tEXt chunk as part of the spec, an image viewer might forgo warning the user before displaying that image.

Or perhaps there is an error in an iCCP chunk. A picture of an apple will still clearly be an apple even if the colors aren't perfectly correct. Should that be displayed? Should the spec dictate correct behavior at all, here?

@ProgramMax
Copy link
Collaborator Author

We could lean on the existing critical chunk & ancillary chunk divide to determine if an error in this chunk should prevent the entire image from being displayed. For example, an error in an ancillary chunk could perhaps be ignored. After all, that is part of the definition of ancillary chunks: "Ancillary chunks may be ignored by a decoder."

But we could also create a new divide for the different forms of error conditions. Maybe we will have more then 2 error handling conditions and thus a 2-way divide is insufficient.

@ProgramMax
Copy link
Collaborator Author

In the Aug 8th, 2022 meeting we agreed that PNG encoders & decoders are already highly motivated to behave in a way the user wants. Any wording we add to the spec will likely provide zero additional motivation.

There were no objections to adding a note to encourage minimizing error severity (Is this really an error? Is a warning more appropriate?) and error surface area (Should we error the whole image or just this chunk?). But again, the note might not be useful.

Instead, we agreed the most useful path forward is to add offending images to a standard test set. This assists PNG encoder & decoder writers with the motivation they already have.

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

No branches or pull requests

1 participant