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

Unknown but valid chunks should raise WARNING, not major or minor ERRORs #1

Closed
ronaldtse opened this issue Oct 3, 2022 · 2 comments · Fixed by #3
Closed

Unknown but valid chunks should raise WARNING, not major or minor ERRORs #1

ronaldtse opened this issue Oct 3, 2022 · 2 comments · Fixed by #3
Assignees
Labels
enhancement New feature or request

Comments

@ronaldtse
Copy link

Reasoning: metanorma/pngcheck-ruby#17 (comment)

Approach as discussed with @maxirmx :

Based on your analisys I will patch pngcheck so that it will return STATUS_WARNING if a chunk of unknown type is found

Agree. I know this is not ideal but it's what is possible.

In case of WARNING we have two options:

  • ignore it and return true
  • raise exception but add status code field to it so that it is possible to recover warnings upstream

The latter please.

@ronaldtse ronaldtse added the enhancement New feature or request label Oct 3, 2022
@maxirmx maxirmx linked a pull request Oct 5, 2022 that will close this issue
4 tasks
@maxirmx
Copy link
Contributor

maxirmx commented Oct 5, 2022

There is obvious bug in the code.
When a chunk of unknown typw is found error is raised if (PUBLIC(chunkid))
However, the standard says that An unknown chunk type is not treated as an error unless it is a critical chunk, so the condition shall be if (PUBLIC(chunkid) && CRITICAL(chunkid))

@ronaldtse
Copy link
Author

Thanks for merging #3 !

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

Successfully merging a pull request may close this issue.

2 participants