Skip to content

Commit

Permalink
Merge pull request #2459 from SixLabors/bp/Issue2456
Browse files Browse the repository at this point in the history
Tiff: Undo horizontal predictor for cmyk images
  • Loading branch information
JimBobSquarePants committed May 18, 2023
2 parents 7d0bbbd + f558e6f commit b9e3cd8
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public static void Undo(Span<byte> pixelBytes, int width, TiffColorType colorTyp
UndoRgb24Bit(pixelBytes, width);
break;
case TiffColorType.Rgba8888:
case TiffColorType.Cmyk:
UndoRgba32Bit(pixelBytes, width);
break;
case TiffColorType.Rgb161616:
Expand Down
1 change: 1 addition & 0 deletions tests/ImageSharp.Tests/Formats/Tiff/TiffDecoderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ public void TiffDecoder_CanDecode_CieLab<TPixel>(TestImageProvider<TPixel> provi

[Theory]
[WithFile(Cmyk, PixelTypes.Rgba32)]
[WithFile(CmykLzwPredictor, PixelTypes.Rgba32)]
public void TiffDecoder_CanDecode_Cmyk<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
{
Expand Down
1 change: 1 addition & 0 deletions tests/ImageSharp.Tests/TestImages.cs
Original file line number Diff line number Diff line change
Expand Up @@ -958,6 +958,7 @@ public static class Tiff

public const string Cmyk = "Tiff/Cmyk.tiff";
public const string Cmyk64BitDeflate = "Tiff/cmyk_deflate_64bit.tiff";
public const string CmykLzwPredictor = "Tiff/Cmyk-lzw-predictor.tiff";

public const string Issues1716Rgb161616BitLittleEndian = "Tiff/Issues/Issue1716.tiff";
public const string Issues1891 = "Tiff/Issues/Issue1891.tiff";
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions tests/Images/Input/Tiff/Cmyk-lzw-predictor.tiff
Git LFS file not shown

0 comments on commit b9e3cd8

Please sign in to comment.