Browse Source

Throw not suported for YCbCr with subsampling

pull/1731/head
Brian Popow 5 years ago
parent
commit
1cbab32468
  1. 8
      src/ImageSharp/Formats/Tiff/README.md
  2. 5
      src/ImageSharp/Formats/Tiff/TiffDecoderOptionsParser.cs

8
src/ImageSharp/Formats/Tiff/README.md

@ -63,7 +63,7 @@
|PaletteColor | Y | Y | General implementation only | |PaletteColor | Y | Y | General implementation only |
|TransparencyMask | | | | |TransparencyMask | | | |
|Separated (TIFF Extension) | | | | |Separated (TIFF Extension) | | | |
|YCbCr (TIFF Extension) | | | | |YCbCr (TIFF Extension) | | Y | |
|CieLab (TIFF Extension) | | | | |CieLab (TIFF Extension) | | | |
|IccLab (TechNote 1) | | | | |IccLab (TechNote 1) | | | |
@ -165,10 +165,10 @@
|JPEGQTables | | | | |JPEGQTables | | | |
|JPEGDCTables | | | | |JPEGDCTables | | | |
|JPEGACTables | | | | |JPEGACTables | | | |
|YCbCrCoefficients | | | | |YCbCrCoefficients | | Y | |
|YCbCrSubSampling | | | | |YCbCrSubSampling | | Y | |
|YCbCrPositioning | | | | |YCbCrPositioning | | | |
|ReferenceBlackWhite | | | | |ReferenceBlackWhite | | Y | |
|StripRowCounts | - | - | See RFC 2301 (File Format for Internet Fax). | |StripRowCounts | - | - | See RFC 2301 (File Format for Internet Fax). |
|XMP | Y | Y | | |XMP | Y | Y | |
|ImageID | | | | |ImageID | | | |

5
src/ImageSharp/Formats/Tiff/TiffDecoderOptionsParser.cs

@ -63,6 +63,11 @@ namespace SixLabors.ImageSharp.Formats.Tiff
TiffThrowHelper.ThrowNotSupported("ImageSharp only supports YCbCr images with equal luma and chroma samples."); TiffThrowHelper.ThrowNotSupported("ImageSharp only supports YCbCr images with equal luma and chroma samples.");
} }
if (ycbcrSubSampling != null && ycbcrSubSampling[0] != 1)
{
TiffThrowHelper.ThrowNotSupported("ImageSharp only supports YCbCr images without subsampling.");
}
if (exifProfile.GetValue(ExifTag.StripRowCounts)?.Value != null) if (exifProfile.GetValue(ExifTag.StripRowCounts)?.Value != null)
{ {
TiffThrowHelper.ThrowNotSupported("Variable-sized strips are not supported."); TiffThrowHelper.ThrowNotSupported("Variable-sized strips are not supported.");

Loading…
Cancel
Save