diff --git a/src/ImageSharp/Formats/Tiff/TiffBitsPerPixel.cs b/src/ImageSharp/Formats/Tiff/TiffBitsPerPixel.cs index 289637fc32..4b65f88b8c 100644 --- a/src/ImageSharp/Formats/Tiff/TiffBitsPerPixel.cs +++ b/src/ImageSharp/Formats/Tiff/TiffBitsPerPixel.cs @@ -24,7 +24,7 @@ namespace SixLabors.ImageSharp.Formats.Tiff Bit8 = 8, /// - /// 14 bits per pixel. 4 bit for each color channel. + /// 12 bits per pixel. 4 bit for each color channel. /// /// Note: The TiffEncoder does not yet support 4 bits per color channel and will default to 24 bits per pixel. /// diff --git a/tests/ImageSharp.Tests/Formats/Tiff/TiffEncoderTests.cs b/tests/ImageSharp.Tests/Formats/Tiff/TiffEncoderTests.cs index 61bccc008d..dd3ef133e6 100644 --- a/tests/ImageSharp.Tests/Formats/Tiff/TiffEncoderTests.cs +++ b/tests/ImageSharp.Tests/Formats/Tiff/TiffEncoderTests.cs @@ -248,6 +248,12 @@ namespace SixLabors.ImageSharp.Tests.Formats.Tiff Assert.Equal(expectedCompression, frameMetaData.Compression); } + // This makes sure, that when decoding a planar tiff, the planar configuration is not carried over to the encoded image. + [Theory] + [WithFile(FlowerRgb444Planar, PixelTypes.Rgba32)] + public void TiffEncoder_EncodePlanar_AndReload_Works(TestImageProvider provider) + where TPixel : unmanaged, IPixel => TestTiffEncoderCore(provider, TiffBitsPerPixel.Bit24, TiffPhotometricInterpretation.Rgb, imageDecoder: new TiffDecoder()); + [Theory] [WithFile(Calliphora_RgbUncompressed, PixelTypes.Rgba32)] public void TiffEncoder_EncodeRgb_Works(TestImageProvider provider) diff --git a/tests/ImageSharp.Tests/Formats/Tiff/TiffMetadataTests.cs b/tests/ImageSharp.Tests/Formats/Tiff/TiffMetadataTests.cs index 68244b3b12..ab350f720e 100644 --- a/tests/ImageSharp.Tests/Formats/Tiff/TiffMetadataTests.cs +++ b/tests/ImageSharp.Tests/Formats/Tiff/TiffMetadataTests.cs @@ -293,7 +293,7 @@ namespace SixLabors.ImageSharp.Tests.Formats.Tiff Assert.Equal(exifProfileInput.GetValue(ExifTag.Copyright).Value, encodedImageExifProfile.GetValue(ExifTag.Copyright).Value); // Note that the encoded profile has PlanarConfiguration explicitly set, which is missing in the original image profile. - Assert.Equal((ushort)TiffPlanarConfiguration.Chunky, encodedImageExifProfile.GetValue(ExifTag.PlanarConfiguration).Value); + Assert.Equal((ushort)TiffPlanarConfiguration.Chunky, encodedImageExifProfile.GetValue(ExifTag.PlanarConfiguration)?.Value); Assert.Equal(exifProfileInput.Values.Count + 1, encodedImageExifProfile.Values.Count); } }