Repository navigation
Strip the metadata from the error image - #119
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The error image follows
DimsStripMetadata. A failed request returns an image with no EXIF, no color profile, and no timestamp. A successful response already does.Why
dims_cleanupsends the error image straight todims_send_image. That path skipsdims_process_image. The default strip runs only indims_process_image, soDimsStripMetadatadid not apply to the error image on any endpoint.The PNG kept a
tIMEchunk and threedate:text chunks that record the wall clock second. Two error images built in one request pair differ whenever the pair crosses a second boundary. Four cases compare those bytes and fail on that boundary:TestCropOffsetOnTheEdge,TestCropXOffsetOutsideImage,TestCropYOffsetOutsideImage, andTestSvgExternalReferenceIsRefused. The first failed about one run in thirteen.dims5.ccallsdims_cleanup, so one change covers/dims3/,/dims4/, and/dims5/.Verify
278 cases pass, every golden file reproduces, and 105 sanitizer cases report no finding. I measured 200 paired error image requests: every pair returned identical bytes. The same measurement on the parent commit returned one differing pair in forty.
Breaking
The error image is 4089 bytes where it was 4337. A caller that reads
Content-Lengthfrom a failed request sees the smaller value. A successful response is byte for byte unchanged, and all 91 golden files reproduce.