-
Notifications
You must be signed in to change notification settings - Fork 636
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 colourspace precedence rules conformance #645
PNGv3 colourspace precedence rules conformance #645
Conversation
@ctruta: tests I performed:
This is good to go and needs to go. |
NOTES: These are in the unsquashed commits but then so is a lot of in-out-shake-it-all-about distraction... The basic strategy I adopted was to eliminate png_colorspace, which only existed to implement the old rules, or more correctly the old lack of rules. This, as I suggested before, removes rather a lot of LoC. LoC counts before and after, the LoC metric is [;,]; I didn't exclude comments (and I added a lot of course): metric: results: #645: 24401 So that's 5% of the code gone. Pretty good for a weeks work IMO. sub-strategy: introduce a log in Given the log when asked a question, like "what is the gamma dude", simply troll through the chunks in the prescribed manner and deduce it. The code, deliberately, does not feel constrained to deduce the result on the fly, although my last revision (the one here) did do that for the chunks in the file. |
This is a major change required by the new PNGv3 colour chunk precedence rules. It **does not** change the libpng API (png.h) however it changes the following handling of PNG files: IFF the PNG file contains colour space information it changes from the libpng v3 behaviour to the now compulsory PNG v3 behaviour: 1) libpng no longer invalidates colour space chunks because they are inconsistent. 2) libpng no longer responds to the "png_get_" APIs positively if they are not present in the PNG but can be deduced from the colour space chunks that are present.
The two new configuation tests, fixed.dfa and float-fixed.dfa verify that the 'standard' configuration of libpng works without floating point arithmetic. Signed-off-by: John Bowler <[email protected]>
34f3090
to
c4b20d0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved, thank you.
@ctruta: the check on the pHYs chunk (CDpHYs in pngrutil.c) incorrectly requires it to be after PLTE. fdAT is also marked as not "multiple" but that's not a problem because the definition is never used. I'll submit a fix soon. |
The fix is in #646 |
This is a major change required by the new PNGv3 colour chunk precedence
rules. It does not change the libpng API (png.h) however it changes
the following handling of PNG files:
IFF the PNG file contains colour space information it changes from the
libpng v3 behaviour to the now compulsory PNG v3 behaviour:
inconsistent.
are not present in the PNG but can be deduced from the colour space
chunks that are present.