Skip to content

Commit b9e3cd8

Browse files
Merge pull request #2459 from SixLabors/bp/Issue2456
Tiff: Undo horizontal predictor for cmyk images
2 parents 7d0bbbd + f558e6f commit b9e3cd8

File tree

5 files changed

+9
-0
lines changed

5 files changed

+9
-0
lines changed

src/ImageSharp/Formats/Tiff/Compression/HorizontalPredictor.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ public static void Undo(Span<byte> pixelBytes, int width, TiffColorType colorTyp
4444
UndoRgb24Bit(pixelBytes, width);
4545
break;
4646
case TiffColorType.Rgba8888:
47+
case TiffColorType.Cmyk:
4748
UndoRgba32Bit(pixelBytes, width);
4849
break;
4950
case TiffColorType.Rgb161616:

tests/ImageSharp.Tests/Formats/Tiff/TiffDecoderTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@ public void TiffDecoder_CanDecode_CieLab<TPixel>(TestImageProvider<TPixel> provi
308308

309309
[Theory]
310310
[WithFile(Cmyk, PixelTypes.Rgba32)]
311+
[WithFile(CmykLzwPredictor, PixelTypes.Rgba32)]
311312
public void TiffDecoder_CanDecode_Cmyk<TPixel>(TestImageProvider<TPixel> provider)
312313
where TPixel : unmanaged, IPixel<TPixel>
313314
{

tests/ImageSharp.Tests/TestImages.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -958,6 +958,7 @@ public static class Tiff
958958

959959
public const string Cmyk = "Tiff/Cmyk.tiff";
960960
public const string Cmyk64BitDeflate = "Tiff/cmyk_deflate_64bit.tiff";
961+
public const string CmykLzwPredictor = "Tiff/Cmyk-lzw-predictor.tiff";
961962

962963
public const string Issues1716Rgb161616BitLittleEndian = "Tiff/Issues/Issue1716.tiff";
963964
public const string Issues1891 = "Tiff/Issues/Issue1891.tiff";
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:d322e42dd61c528e91ba9d16310248a4b9a77094a22761dcb9e6f132fc16fe1b
3+
size 1080

0 commit comments

Comments
 (0)