Relaxed handle of corrupt png files#2589
Merged
JimBobSquarePants merged 8 commits intoNov 29, 2023
Merged
Conversation
Member
|
@svenclaesson could you please explicitly invite me to contribute to your fork. I need to add the test image from above and due to a quirk in Git LFS permissions with GitHub I cannot push any images to your fork without being invited. @dlemstra is there a way to get the Magick decoder to break on adaptive filter errors? When I try to use your decoder as a reference for this file the following exception is thrown. |
Member
|
Thanks for the invite. @svenclaesson I've now reworked the decoder to allow granular control of CRC checking and also allow us to decode the provided image. |
| Assert.Equal(1, this.DefaultFormatsManager.ImageDecoders.Select(item => item.Value).OfType<BmpDecoder>().Count()); | ||
| Assert.Equal(1, this.DefaultFormatsManager.ImageDecoders.Select(item => item.Value).OfType<JpegDecoder>().Count()); | ||
| Assert.Equal(1, this.DefaultFormatsManager.ImageDecoders.Select(item => item.Value).OfType<BmpDecoder>().Count()); | ||
| Assert.Equal(1, this.DefaultFormatsManager.ImageDecoders.Select(item => item.Value).OfType<GifDecoder>().Count()); |
Contributor
Author
|
Thanks for working on this |
Closed
4 tasks
| } | ||
|
|
||
| while (length < 0 || length > (this.currentStream.Length - this.currentStream.Position)) | ||
| while (length < 0) |
4 tasks
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.

Prerequisites
Description
WIP support for handing truncated png files
Implementing an option for PngDecoder, IgnoreCrcErrors
Tried it a bit but got stuck by the fact that IDAT and IEND is considered critical chunks and found no way of ignoring that fact if the file is truncated, IDAT is cut off and IEND is missing.
This file is truncated and i'm trying to get a partial result converted as libpng (chrome) and WIC can do.

Maybe you have some pointers for me
See #2570