-
-
Notifications
You must be signed in to change notification settings - Fork 855
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2589 from svenclaesson/better_handle_corrupt_png
Relaxed handle of corrupt png files
- Loading branch information
Showing
11 changed files
with
191 additions
and
47 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright (c) Six Labors. | ||
// Licensed under the Six Labors Split License. | ||
|
||
namespace SixLabors.ImageSharp.Formats.Png; | ||
|
||
/// <summary> | ||
/// Specifies how to handle validation of any CRC (Cyclic Redundancy Check) data within the encoded PNG. | ||
/// </summary> | ||
public enum PngCrcChunkHandling | ||
{ | ||
/// <summary> | ||
/// Do not ignore any CRC chunk errors. | ||
/// </summary> | ||
IgnoreNone, | ||
|
||
/// <summary> | ||
/// Ignore CRC errors in non critical chunks. | ||
/// </summary> | ||
IgnoreNonCritical, | ||
|
||
/// <summary> | ||
/// Ignore CRC errors in data chunks. | ||
/// </summary> | ||
IgnoreData, | ||
|
||
/// <summary> | ||
/// Ignore CRC errors in all chunks. | ||
/// </summary> | ||
IgnoreAll | ||
} |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright (c) Six Labors. | ||
// Licensed under the Six Labors Split License. | ||
|
||
namespace SixLabors.ImageSharp.Formats.Png; | ||
|
||
/// <summary> | ||
/// Configuration options for decoding png images. | ||
/// </summary> | ||
public sealed class PngDecoderOptions : ISpecializedDecoderOptions | ||
{ | ||
/// <inheritdoc/> | ||
public DecoderOptions GeneralOptions { get; init; } = new DecoderOptions(); | ||
|
||
/// <summary> | ||
/// Gets a value indicating how to handle validation of any CRC (Cyclic Redundancy Check) data within the encoded PNG. | ||
/// </summary> | ||
public PngCrcChunkHandling PngCrcChunkHandling { get; init; } = PngCrcChunkHandling.IgnoreNonCritical; | ||
} |
This file contains 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
Oops, something went wrong.