From 036b95bd7a49ba105febee78c88198fa0e07ba08 Mon Sep 17 00:00:00 2001 From: Brian Popow Date: Thu, 3 Jun 2021 14:44:20 +0200 Subject: [PATCH] Flip order of comparing bitsPerSample --- .../TiffColorDecoderFactory{TPixel}.cs | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/ImageSharp/Formats/Tiff/PhotometricInterpretation/TiffColorDecoderFactory{TPixel}.cs b/src/ImageSharp/Formats/Tiff/PhotometricInterpretation/TiffColorDecoderFactory{TPixel}.cs index 924415850..5555eb537 100644 --- a/src/ImageSharp/Formats/Tiff/PhotometricInterpretation/TiffColorDecoderFactory{TPixel}.cs +++ b/src/ImageSharp/Formats/Tiff/PhotometricInterpretation/TiffColorDecoderFactory{TPixel}.cs @@ -60,9 +60,9 @@ namespace SixLabors.ImageSharp.Formats.Tiff.PhotometricInterpretation case TiffColorType.Rgb222: DebugGuard.IsTrue( bitsPerSample.Length == 3 - && bitsPerSample[0] == 2 + && bitsPerSample[2] == 2 && bitsPerSample[1] == 2 - && bitsPerSample[2] == 2, + && bitsPerSample[0] == 2, "bitsPerSample"); DebugGuard.IsTrue(colorMap == null, "colorMap"); return new RgbTiffColor(bitsPerSample); @@ -70,9 +70,9 @@ namespace SixLabors.ImageSharp.Formats.Tiff.PhotometricInterpretation case TiffColorType.Rgb444: DebugGuard.IsTrue( bitsPerSample.Length == 3 - && bitsPerSample[0] == 4 + && bitsPerSample[2] == 4 && bitsPerSample[1] == 4 - && bitsPerSample[2] == 4, + && bitsPerSample[0] == 4, "bitsPerSample"); DebugGuard.IsTrue(colorMap == null, "colorMap"); return new Rgb444TiffColor(); @@ -80,9 +80,9 @@ namespace SixLabors.ImageSharp.Formats.Tiff.PhotometricInterpretation case TiffColorType.Rgb888: DebugGuard.IsTrue( bitsPerSample.Length == 3 - && bitsPerSample[0] == 8 + && bitsPerSample[2] == 8 && bitsPerSample[1] == 8 - && bitsPerSample[2] == 8, + && bitsPerSample[0] == 8, "bitsPerSample"); DebugGuard.IsTrue(colorMap == null, "colorMap"); return new Rgb888TiffColor(); @@ -90,9 +90,9 @@ namespace SixLabors.ImageSharp.Formats.Tiff.PhotometricInterpretation case TiffColorType.Rgb101010: DebugGuard.IsTrue( bitsPerSample.Length == 3 - && bitsPerSample[0] == 10 + && bitsPerSample[2] == 10 && bitsPerSample[1] == 10 - && bitsPerSample[2] == 10, + && bitsPerSample[0] == 10, "bitsPerSample"); DebugGuard.IsTrue(colorMap == null, "colorMap"); return new RgbTiffColor(bitsPerSample); @@ -100,9 +100,9 @@ namespace SixLabors.ImageSharp.Formats.Tiff.PhotometricInterpretation case TiffColorType.Rgb141414: DebugGuard.IsTrue( bitsPerSample.Length == 3 - && bitsPerSample[0] == 14 + && bitsPerSample[2] == 14 && bitsPerSample[1] == 14 - && bitsPerSample[2] == 14, + && bitsPerSample[0] == 14, "bitsPerSample"); DebugGuard.IsTrue(colorMap == null, "colorMap"); return new RgbTiffColor(bitsPerSample);