SixLabors/ImageSharp · error · NotSupportedException

Not supported decoder compression method

Error message

Not supported decoder compression method: {compressionType}

What it means

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.

Solutions

  1. 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.
  2. If it is a compression you believe should be supported, check ImageSharp docs/issues and upgrade to the latest version.
  3. Catch NotSupportedException in bulk pipelines and route such files to libtiff-based tooling for conversion.

Example fix

// before
using var img = Image.Load("scanner.tif"); // NotSupportedException: decoder compression 32809
// after (shell): tiffcp -c lzw scanner.tif scanner-lzw.tif
using var img = Image.Load("scanner-lzw.tif");
Defensive patterns

Strategy: try-catch

Validate before calling

ushort compression = GetTiffCompressionTag(path); // read tag 259 via your own parser
if (compression != 1 && compression != 5 && compression != 7 && compression != 8 && compression != 4)
    Console.WriteLine($"Compression {compression} may be unsupported");

Try / catch

try { using var img = Image.Load(path); }
catch (NotSupportedException ex) when (ex.Message.Contains("decoder compression"))
{
    // convert via tiffcp -c lzw and retry
}

Prevention

When it happens

Trigger: 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.

Common situations: Scanner/vendor-produced TIFFs with proprietary compression; files saved by tools using compression codes outside the standard set.

Related errors


AI-assisted analysis of SixLabors/ImageSharp@59ce6af6fc (2026-09-13). Data as JSON: /api/errors/be4670c5e04f27fe. Report an issue: GitHub.

Appendix: source

Thrown at src/ImageSharp/Formats/Tiff/TiffThrowHelper.cs:17

// Copyright (c) Six Labors.
// Licensed under the Six Labors Split License.

using System.Diagnostics.CodeAnalysis;

namespace SixLabors.ImageSharp.Formats.Tiff;

internal static class TiffThrowHelper
{
    [DoesNotReturn]
    public static Exception ThrowImageFormatException(string errorMessage) => throw new ImageFormatException(errorMessage);

    [DoesNotReturn]
    public static Exception ThrowInvalidImageContentException(string errorMessage) => throw new InvalidImageContentException(errorMessage);

    [DoesNotReturn]
    public static Exception NotSupportedDecompressor(string compressionType) => throw new NotSupportedException($"Not supported decoder compression method: {compressionType}");

    [DoesNotReturn]
    public static Exception NotSupportedCompressor(string compressionType) => throw new NotSupportedException($"Not supported encoder compression method: {compressionType}");

    [DoesNotReturn]
    public static Exception InvalidColorType(string colorType) => throw new NotSupportedException($"Invalid color type: {colorType}");

    [DoesNotReturn]
    public static Exception ThrowInvalidHeader() => throw new ImageFormatException("Invalid TIFF file header.");

    [DoesNotReturn]
    public static void ThrowNotSupported(string message) => throw new NotSupportedException(message);

    [DoesNotReturn]
    public static void ThrowArgumentException(string message) => throw new ArgumentException(message);
}

View on GitHub (pinned to 59ce6af6fc)