Browse Source
Merge pull request #2201 from SixLabors/bp/issue2179
Tiff: Make sure 1 Bit compression is only used with 1 bit pixel type
pull/2207/head
Brian Popow
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
7 additions and
0 deletions
-
src/ImageSharp/Formats/Tiff/TiffEncoderCore.cs
|
|
|
@ -417,6 +417,13 @@ namespace SixLabors.ImageSharp.Formats.Tiff |
|
|
|
return; |
|
|
|
|
|
|
|
case TiffPhotometricInterpretation.Rgb: |
|
|
|
// Make sure 1 Bit compression is only used with 1 bit pixel type.
|
|
|
|
if (IsOneBitCompression(this.CompressionType)) |
|
|
|
{ |
|
|
|
// Invalid compression / bits per pixel combination, fallback to no compression.
|
|
|
|
compression = DefaultCompression; |
|
|
|
} |
|
|
|
|
|
|
|
this.SetEncoderOptions(TiffBitsPerPixel.Bit24, photometricInterpretation, compression, predictor); |
|
|
|
return; |
|
|
|
} |
|
|
|
|