diff --git a/src/ImageSharp/Formats/Tiff/Constants/TiffPhotometricInterpretation.cs b/src/ImageSharp/Formats/Tiff/Constants/TiffPhotometricInterpretation.cs index cb537dda3c..6585be6f2f 100644 --- a/src/ImageSharp/Formats/Tiff/Constants/TiffPhotometricInterpretation.cs +++ b/src/ImageSharp/Formats/Tiff/Constants/TiffPhotometricInterpretation.cs @@ -9,9 +9,8 @@ namespace SixLabors.ImageSharp.Formats.Tiff.Constants; public enum TiffPhotometricInterpretation : ushort { /// - /// Bilevel and grayscale: 0 is imaged as white. The maximum value is imaged as black. - /// - /// Not supported by the TiffEncoder. + /// Bilevel and grayscale: 0 is imaged as white. The maximum value is imaged as black. + /// Not supported by the TiffEncoder. /// WhiteIsZero = 0, @@ -31,58 +30,50 @@ public enum TiffPhotometricInterpretation : ushort PaletteColor = 3, /// - /// A transparency mask. - /// - /// Not supported by the TiffEncoder. + /// A transparency mask. + /// Not supported by the TiffEncoder. /// TransparencyMask = 4, /// - /// Separated: usually CMYK (see Section 16 of the TIFF 6.0 specification). - /// - /// Not supported by the TiffEncoder. + /// Separated: usually CMYK (see Section 16 of the TIFF 6.0 specification). + /// Not supported by the TiffEncoder. /// Separated = 5, /// - /// YCbCr (see Section 21 of the TIFF 6.0 specification). - /// - /// Not supported by the TiffEncoder. + /// YCbCr (see Section 21 of the TIFF 6.0 specification). + /// Not supported by the TiffEncoder. /// YCbCr = 6, /// - /// 1976 CIE L*a*b* (see Section 23 of the TIFF 6.0 specification). - /// - /// Not supported by the TiffEncoder. + /// 1976 CIE L*a*b* (see Section 23 of the TIFF 6.0 specification). + /// Not supported by the TiffEncoder. /// CieLab = 8, /// - /// ICC L*a*b* (see TIFF Specification, supplement 1). - /// - /// Not supported by the TiffEncoder. + /// ICC L*a*b* (see TIFF Specification, supplement 1). + /// Not supported by the TiffEncoder. /// IccLab = 9, /// - /// ITU L*a*b* (see RFC2301). - /// - /// Not supported by the TiffEncoder. + /// ITU L*a*b* (see RFC2301). + /// Not supported by the TiffEncoder. /// ItuLab = 10, /// - /// Color Filter Array (see the DNG specification). - /// - /// Not supported by the TiffEncoder. + /// Color Filter Array (see the DNG specification). + /// Not supported by the TiffEncoder. /// ColorFilterArray = 32803, /// - /// Linear Raw (see the DNG specification). - /// - /// Not supported by the TiffEncoder. + /// Linear Raw (see the DNG specification). + /// Not supported by the TiffEncoder. /// LinearRaw = 34892 } diff --git a/src/ImageSharp/Formats/Tiff/TiffBitsPerPixel.cs b/src/ImageSharp/Formats/Tiff/TiffBitsPerPixel.cs index dc57c12f19..6cbacec354 100644 --- a/src/ImageSharp/Formats/Tiff/TiffBitsPerPixel.cs +++ b/src/ImageSharp/Formats/Tiff/TiffBitsPerPixel.cs @@ -19,9 +19,8 @@ public enum TiffBitsPerPixel Bit4 = 4, /// - /// 6 bits per pixel. 2 bit for each color channel. - /// - /// Note: The TiffEncoder does not yet support 2 bits per color channel and will default to 24 bits per pixel instead. + /// 6 bits per pixel. 2 bit for each color channel. + /// Note: The TiffEncoder does not yet support 2 bits per color channel and will default to 24 bits per pixel instead. /// Bit6 = 6, @@ -31,30 +30,26 @@ public enum TiffBitsPerPixel Bit8 = 8, /// - /// 10 bits per pixel, for gray images. - /// - /// Note: The TiffEncoder does not yet support 10 bits per pixel and will default to 24 bits per pixel instead. + /// 10 bits per pixel, for gray images. + /// Note: The TiffEncoder does not yet support 10 bits per pixel and will default to 24 bits per pixel instead. /// Bit10 = 10, /// - /// 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 instead. + /// 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 instead. /// Bit12 = 12, /// - /// 14 bits per pixel, for gray images. - /// - /// Note: The TiffEncoder does not yet support 14 bits per pixel images and will default to 24 bits per pixel instead. + /// 14 bits per pixel, for gray images. + /// Note: The TiffEncoder does not yet support 14 bits per pixel images and will default to 24 bits per pixel instead. /// Bit14 = 14, /// - /// 16 bits per pixel, for gray images. - /// - /// Note: The TiffEncoder does not yet support 16 bits per color channel and will default to 16 bits grayscale instead. + /// 16 bits per pixel, for gray images. + /// Note: The TiffEncoder does not yet support 16 bits per color channel and will default to 16 bits grayscale instead. /// Bit16 = 16, @@ -64,9 +59,8 @@ public enum TiffBitsPerPixel Bit24 = 24, /// - /// 30 bits per pixel. 10 bit for each color channel. - /// - /// Note: The TiffEncoder does not yet support 10 bits per color channel and will default to 24 bits per pixel instead. + /// 30 bits per pixel. 10 bit for each color channel. + /// Note: The TiffEncoder does not yet support 10 bits per color channel and will default to 24 bits per pixel instead. /// Bit30 = 30, @@ -76,23 +70,26 @@ public enum TiffBitsPerPixel Bit32 = 32, /// - /// 36 bits per pixel. 12 bit for each color channel. - /// - /// Note: The TiffEncoder does not yet support 12 bits per color channel and will default to 24 bits per pixel instead. + /// 36 bits per pixel. 12 bit for each color channel. + /// Note: The TiffEncoder does not yet support 12 bits per color channel and will default to 24 bits per pixel instead. /// Bit36 = 36, /// - /// 42 bits per pixel. 14 bit for each color channel. - /// - /// Note: The TiffEncoder does not yet support 14 bits per color channel and will default to 24 bits per pixel instead. + /// 42 bits per pixel. 14 bit for each color channel. + /// Note: The TiffEncoder does not yet support 14 bits per color channel and will default to 24 bits per pixel instead. /// Bit42 = 42, /// - /// 48 bits per pixel. 16 bit for each color channel. - /// - /// Note: The TiffEncoder does not yet support 16 bits per color channel and will default to 24 bits per pixel instead. + /// 48 bits per pixel. 16 bit for each color channel. + /// Note: The TiffEncoder does not yet support 16 bits per color channel and will default to 24 bits per pixel instead. /// Bit48 = 48, + + /// + /// 64 bits per pixel. 16 bit for each color channel. + /// Note: The TiffEncoder does not yet support 16 bits per color channel and will default to 32 bits per pixel instead. + /// + Bit64 = 64, } diff --git a/src/ImageSharp/Formats/Tiff/TiffEncoderCore.cs b/src/ImageSharp/Formats/Tiff/TiffEncoderCore.cs index 94c7fb2b1e..ba8d2bd23e 100644 --- a/src/ImageSharp/Formats/Tiff/TiffEncoderCore.cs +++ b/src/ImageSharp/Formats/Tiff/TiffEncoderCore.cs @@ -391,6 +391,10 @@ internal sealed class TiffEncoderCore : IImageEncoderInternals // Encoding not yet supported bits per pixel will default to 24 bits. this.SetEncoderOptions(TiffBitsPerPixel.Bit24, TiffPhotometricInterpretation.Rgb, compression, TiffPredictor.None); break; + case TiffBitsPerPixel.Bit64: + // Encoding not yet supported bits per pixel will default to 32 bits. + this.SetEncoderOptions(TiffBitsPerPixel.Bit32, TiffPhotometricInterpretation.Rgb, compression, TiffPredictor.None); + break; default: this.SetEncoderOptions(bitsPerPixel, TiffPhotometricInterpretation.Rgb, compression, predictor); break; diff --git a/tests/ImageSharp.Tests/Formats/Tiff/TiffMetadataTests.cs b/tests/ImageSharp.Tests/Formats/Tiff/TiffMetadataTests.cs index 40346cdd89..b671addf95 100644 --- a/tests/ImageSharp.Tests/Formats/Tiff/TiffMetadataTests.cs +++ b/tests/ImageSharp.Tests/Formats/Tiff/TiffMetadataTests.cs @@ -111,7 +111,7 @@ public class TiffMetadataTests [Theory] [InlineData(Cmyk, 1, TiffBitsPerPixel.Bit32, TiffPhotometricInterpretation.Separated, TiffInkSet.Cmyk)] - [InlineData(Cmyk64BitDeflate, 1, 64, TiffPhotometricInterpretation.Separated, TiffInkSet.Cmyk)] + [InlineData(Cmyk64BitDeflate, 1, TiffBitsPerPixel.Bit64, TiffPhotometricInterpretation.Separated, TiffInkSet.Cmyk)] [InlineData(YCbCrJpegCompressed, 1, TiffBitsPerPixel.Bit24, TiffPhotometricInterpretation.YCbCr, null)] public void Identify_Frames(string imagePath, int framesCount, TiffBitsPerPixel bitsPerPixel, TiffPhotometricInterpretation photometric, TiffInkSet? inkSet) {