QL-Win/QuickLook · warning · NotSupportedException

Plugin NOT support deb with LZMA algorithm

Error message

Plugin NOT support deb with LZMA algorithm

What it means

Thrown by DebReader.CreateDecompressionStream when the control.tar member inside a .deb archive uses LZMA compression (.tar.lzma). The plugin's decompression switch handles Deflate, BZip2, and Xz but explicitly rejects LZMA via NotSupportedException because no LZMA decompressor is wired in.

Source

Thrown at QuickLook.Plugin/QuickLook.Plugin.AppViewer/PackageParsers/Deb/DebReader.cs:134

        return ZipCompressionMethod.None;
    }

    private static Stream CreateDecompressionStream(Stream stream, ZipCompressionMethod method)
    {
        switch (method)
        {
            case ZipCompressionMethod.Deflate:
                {
                    return new GZipStream(stream, CompressionMode.Decompress);
                }
            case ZipCompressionMethod.BZip2:
                {
                    return new BZip2Stream(stream, CompressionMode.Decompress, false);
                }
            case ZipCompressionMethod.LZMA:
                {
                    throw new NotSupportedException("Plugin NOT support deb with LZMA algorithm");
                }
            case ZipCompressionMethod.Xz:
                {
                    return new XZStream(stream);
                }
            case ZipCompressionMethod.ZStd:
                {
                    throw new NotSupportedException("Plugin NOT support deb with ZStd algorithm");
                }
        }

        return stream;
    }

    private enum ZipCompressionMethod
    {
        None = 0,
        Deflate = 8,

View on GitHub (pinned to cb5d9c429c)

Solutions

  1. Re-package or re-compress the .deb's control.tar with gzip (.tar.gz) or xz (.tar.xz) so the plugin can parse it.
  2. Add an LZMA decompressor (e.g. SevenZipExtractor or ManagedLzma) to the LZMA case in CreateDecompressionStream.
  3. Pre-filter: before constructing DebReader, check the ar member name and skip / warn for .tar.lzma packages.
  4. Catch NotSupportedException at the call site and degrade gracefully (show metadata without control fields).

Example fix

// before
case ZipCompressionMethod.LZMA:
    throw new NotSupportedException("Plugin NOT support deb with LZMA algorithm");

// after (add an LZMA stream provider)
case ZipCompressionMethod.LZMA:
    return new LzmaDecompressStream(stream);
Defensive patterns

Strategy: validation

Validate before calling

// Check the control member name before constructing DebReader.
public static bool DebUsesSupportedCompression(string path)
{
    var ar = QuickLook.Plugin.AppViewer.PackageParsers.Deb.ArReader.Read(path);
    var ctrl = Array.Find(ar, e => e.FileName.StartsWith("control.tar"));
    if (ctrl == null) return true;
    string n = ctrl.FileName.ToLowerInvariant();
    return !n.EndsWith(".tar.lzma"); // LZMA not supported
}

Try / catch

try { var reader = new DebReader(path); }
catch (NotSupportedException ex) when (ex.Message.Contains("LZMA"))
{
    // LZMA-compressed control.tar is unsupported;
    // show package metadata without control fields or re-compress the package.
}

Prevention

When it happens

Trigger: Constructing new DebReader(path) on a Debian package whose ar archive contains a member named control.tar.lzma; GetCompressionMethodFromFileName returns ZipCompressionMethod.LZMA, and CreateDecompressionStream hits the LZMA case.

Common situations: Older Debian/Ubuntu packages or packages produced with dpkg-deb -Zlzma; custom embedded firmware .deb files; a package re-compressed by a tool that defaults to LZMA. Modern Debian typically uses .tar.xz or .tar.gz, so LZMA is rare but still spec-valid.

Related errors


AI-assisted analysis of QL-Win/QuickLook@cb5d9c429c (2026-08-13). Data as JSON: /api/errors/88cdefe668a13edd. Report an issue: GitHub.