{"record":{"id":"6c3f7f83b9b2a309","repo":"QL-Win/QuickLook","slug":"plugin-not-support-deb-with-zstd-algorithm","errorCode":null,"errorMessage":"Plugin NOT support deb with ZStd algorithm","messagePattern":"Plugin NOT support deb with ZStd algorithm","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"warning","filePath":"QuickLook.Plugin/QuickLook.Plugin.AppViewer/PackageParsers/Deb/DebReader.cs","lineNumber":142,"sourceCode":"            case ZipCompressionMethod.Deflate:\n                {\n                    return new GZipStream(stream, CompressionMode.Decompress);\n                }\n            case ZipCompressionMethod.BZip2:\n                {\n                    return new BZip2Stream(stream, CompressionMode.Decompress, false);\n                }\n            case ZipCompressionMethod.LZMA:\n                {\n                    throw new NotSupportedException(\"Plugin NOT support deb with LZMA algorithm\");\n                }\n            case ZipCompressionMethod.Xz:\n                {\n                    return new XZStream(stream);\n                }\n            case ZipCompressionMethod.ZStd:\n                {\n                    throw new NotSupportedException(\"Plugin NOT support deb with ZStd algorithm\");\n                }\n        }\n\n        return stream;\n    }\n\n    private enum ZipCompressionMethod\n    {\n        None = 0,\n        Deflate = 8,\n        BZip2 = 12,\n        LZMA = 14,\n        ZStd = 93,\n        Xz = 95,\n    }\n}\n","sourceCodeStart":124,"sourceCodeEnd":159,"githubUrl":"https://github.com/QL-Win/QuickLook/blob/cb5d9c429c81d9796fac469da2a68efb5626946d/QuickLook.Plugin/QuickLook.Plugin.AppViewer/PackageParsers/Deb/DebReader.cs#L124-L159","documentation":"Thrown by DebReader.CreateDecompressionStream when the control.tar member inside a .deb uses Zstandard compression (.tar.zst). The plugin has no Zstd decompressor and rejects it via NotSupportedException.","triggerScenarios":"Constructing new DebReader(path) on a Debian package whose ar archive contains a member named control.tar.zst; GetCompressionMethodFromFileName returns ZipCompressionMethod.ZStd, hitting the ZStd case.","commonSituations":"Recent Debian/Ubuntu releases (Debian 13+, Ubuntu 24.04+) increasingly default to zstd for package data and sometimes control; packages built with dpkg-deb -Zzstd. Users previewing modern packages hit this as Zstd adoption grows.","solutions":["Add a Zstd decompressor (e.g. ZstdNet or IronCompress with zstd) to the ZStd case in CreateDecompressionStream.","Re-compress the control member as gzip or xz if you control the package build.","Pre-filter the ar member name for .tar.zst and skip / warn before constructing DebReader.","Catch NotSupportedException and display partial metadata without the control fields."],"exampleFix":"// before\ncase ZipCompressionMethod.ZStd:\n    throw new NotSupportedException(\"Plugin NOT support deb with ZStd algorithm\");\n\n// after\ncase ZipCompressionMethod.ZStd:\n    return new ZstdDecompressStream(stream);","handlingStrategy":"validation","validationCode":"// Check the control member name before constructing DebReader.\npublic static bool DebUsesSupportedCompression(string path)\n{\n    var ar = QuickLook.Plugin.AppViewer.PackageParsers.Deb.ArReader.Read(path);\n    var ctrl = Array.Find(ar, e => e.FileName.StartsWith(\"control.tar\"));\n    if (ctrl == null) return true;\n    string n = ctrl.FileName.ToLowerInvariant();\n    return !n.EndsWith(\".tar.zst\"); // ZStd not supported\n}","typeGuard":null,"tryCatchPattern":"try { var reader = new DebReader(path); }\ncatch (NotSupportedException ex) when (ex.Message.Contains(\"ZStd\"))\n{\n    // Zstandard-compressed control.tar is unsupported;\n    // show package metadata without control fields or re-compress.\n}","preventionTips":["Re-compress .deb control.tar as gzip or xz when possible.","Be aware recent Debian/Ubuntu defaults increasingly use zstd.","Pre-scan the ar member name and warn on .tar.zst before parsing.","Catch NotSupportedException to degrade gracefully."],"tags":["deb","compression","zstd","notsupported","csharp"],"backgroundTag":null,"analyzedSha":"cb5d9c429c81d9796fac469da2a68efb5626946d","analyzedAt":"2026-08-13T11:51:01.370Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}