{"record":{"id":"be4670c5e04f27fe","repo":"SixLabors/ImageSharp","slug":"not-supported-decoder-compression-method-compressiontype-be4670","errorCode":null,"errorMessage":"Not supported decoder compression method: {compressionType}","messagePattern":"Not supported decoder compression method: (.+?)","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"src/ImageSharp/Formats/Tiff/TiffThrowHelper.cs","lineNumber":17,"sourceCode":"// Copyright (c) Six Labors.\n// Licensed under the Six Labors Split License.\n\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace SixLabors.ImageSharp.Formats.Tiff;\n\ninternal static class TiffThrowHelper\n{\n    [DoesNotReturn]\n    public static Exception ThrowImageFormatException(string errorMessage) => throw new ImageFormatException(errorMessage);\n\n    [DoesNotReturn]\n    public static Exception ThrowInvalidImageContentException(string errorMessage) => throw new InvalidImageContentException(errorMessage);\n\n    [DoesNotReturn]\n    public static Exception NotSupportedDecompressor(string compressionType) => throw new NotSupportedException($\"Not supported decoder compression method: {compressionType}\");\n\n    [DoesNotReturn]\n    public static Exception NotSupportedCompressor(string compressionType) => throw new NotSupportedException($\"Not supported encoder compression method: {compressionType}\");\n\n    [DoesNotReturn]\n    public static Exception InvalidColorType(string colorType) => throw new NotSupportedException($\"Invalid color type: {colorType}\");\n\n    [DoesNotReturn]\n    public static Exception ThrowInvalidHeader() => throw new ImageFormatException(\"Invalid TIFF file header.\");\n\n    [DoesNotReturn]\n    public static void ThrowNotSupported(string message) => throw new NotSupportedException(message);\n\n    [DoesNotReturn]\n    public static void ThrowArgumentException(string message) => throw new ArgumentException(message);\n}\n","sourceCodeStart":1,"sourceCodeEnd":34,"githubUrl":"https://github.com/SixLabors/ImageSharp/blob/59ce6af6fc29027cda277ef62d4d1694a8acce91/src/ImageSharp/Formats/Tiff/TiffThrowHelper.cs#L1-L34","documentation":"TiffThrowHelper.NotSupportedDecompressor throws NotSupportedException when the TIFF's compression tag names a decompressor the decoder has no implementation for. The message includes the raw compression type value from the file.","triggerScenarios":"Image.Load of a TIFF whose Compression tag (259) holds a value with no registered decoder path — e.g. exotic vendor-specific compressions (ThunderScan 32771 variants, LZMA variants not mapped, uncompressed-with-odd-layouts) or an out-of-range tag value.","commonSituations":"Scanner/vendor-produced TIFFs with proprietary compression; files saved by tools using compression codes outside the standard set.","solutions":["Identify the compression with tiffinfo; if the value is nonstandard, re-save the file with a common compression: tiffcp -c lzw in.tif out.tif.","If it is a compression you believe should be supported, check ImageSharp docs/issues and upgrade to the latest version.","Catch NotSupportedException in bulk pipelines and route such files to libtiff-based tooling for conversion."],"exampleFix":"// before\nusing var img = Image.Load(\"scanner.tif\"); // NotSupportedException: decoder compression 32809\n// after (shell): tiffcp -c lzw scanner.tif scanner-lzw.tif\nusing var img = Image.Load(\"scanner-lzw.tif\");","handlingStrategy":"try-catch","validationCode":"ushort compression = GetTiffCompressionTag(path); // read tag 259 via your own parser\nif (compression != 1 && compression != 5 && compression != 7 && compression != 8 && compression != 4)\n    Console.WriteLine($\"Compression {compression} may be unsupported\");","typeGuard":null,"tryCatchPattern":"try { using var img = Image.Load(path); }\ncatch (NotSupportedException ex) when (ex.Message.Contains(\"decoder compression\"))\n{\n    // convert via tiffcp -c lzw and retry\n}","preventionTips":["Read the compression tag before decoding to pre-check support","Normalize vendor TIFFs to standard compressions (LZW/Deflate) at ingest","Track ImageSharp releases for newly supported compressions"],"tags":["tiff","decoding","compression","unsupported"],"backgroundTag":"unsupported-enum-value","analyzedSha":"59ce6af6fc29027cda277ef62d4d1694a8acce91","analyzedAt":"2026-09-13T18:34:59.331Z","contentChangedAt":"2026-09-13T18:34:59.331Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}