mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-06 13:34:58 +00:00
NotSupportedException for 7zip Archive using Ultra Compression #407
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @nightblade9 on GitHub (Jul 16, 2020).
I zipped up a file using 7zip (file manager / GUI). I tried with both LZMA and LZMA2, using ultra compression. I can't seem to figure out how to extract it; I always get a
NotSupportedException.Here are the two snippets I tried with the archiving API, which supposedly works?
I think they fail with the same exception. Here's the stack trace for the second one:
I'm sure it must be something I'm doing wrong (perhaps in my 7zip archive creation?) but I can't figure out what or how to make this work.
@adamhathcock commented on GitHub (Jul 16, 2020):
It's likely hitting the default case in the below switch statement that means it's an implemented method of compression
@nightblade9 commented on GitHub (Jul 16, 2020):
Is there something wrong with my archive that it's not triggering the
K_LZMAorK_LZMA2cases?Is there a work-around or some other steps I can take to get this working?
Do you want me to attach the archive so you can debug it further?
@adamhathcock commented on GitHub (Jul 16, 2020):
I can tell you I'm not going to get any time to debug this. You can debug it yourself and see what the ID is.
Like I said, I'm guessing it's something newish that isn't implemented. Might be LZMA with different settings but no idea.
@nightblade9 commented on GitHub (Jul 17, 2020):
Ok, no worries.
I got this working with a different NuGet package.
@adamhathcock commented on GitHub (Jul 17, 2020):
If you've found a solution that doesn't use the native library, let me know. I'll leave this issue open as a reminder there's a new compression method in 7Zip
@nightblade9 commented on GitHub (Jul 17, 2020):
I switched to SevenZipExtractor, which describes itself as "C# wrapper for 7z.dll (x86 and x64 included)."
I don't think it's a new compression method, but I didn't go beyond the 7-zip GUI, which suggested that I'm using "LZMA" or "LZMA2" - both of which throw the same exception.
@Erior commented on GitHub (Feb 14, 2021):
Tried to recreate this but failed, 7zip file worked in my case, any hints on how to trigger or if you have a test file somewhere @nightblade9 ?
@nightblade9 commented on GitHub (Feb 14, 2021):
As I mentioned, I switched to SevenZipExtractor. The repro case for the zip file wasn't anything special, just a regular MP3 file. My initial comment in this issue mentions this, you can try that:
This is referring to the 7-zip GUI file manager (
7zFM.exeon Windows), hope that helps.@Erior commented on GitHub (Feb 16, 2023):
Ah, music files, that would probably then be the Delta filter
https://www.reddit.com/r/touhou/comments/44thjk/use_7zips_delta_filter_to_decrease_the_size_of/
as in "const UInt32 k_Delta = 3;"
On Tue, Feb 14, 2023 at 11:52 PM TraceEntertains @.***>
wrote:
--
There is nothing that cannot be solved through sufficient application of
brute force and ignorance.
@TraceEntertains commented on GitHub (Feb 18, 2023):
I managed to make sufficient progress on implementing the delta filter after many times asking in the C# discord server, using ChatGPT, et cetera. I am currently stuck, as the buffer size passed to it when it gets read is 128kb, but the output size is less than that, and it seems to be causing problems (garbage data, preventing extraction of further files, etc).
@TraceEntertains commented on GitHub (Feb 18, 2023):
Currently my error is that after one file gets finished, a 0-byte decompress (happens a lot with delta decoding, atleast with my code), actually has a size of "count (of the file before the 0-byte) - 131072" (that file usually having around 80-90k bytes, so not 128kb, and ending up underflowing when trying to initialize a negative sized array)
If you want to help, please reach out to me on discord: TraceEntertains#5092
I really want to see Delta decompression on this get added, as it is one of the final roadblocks (that I can tell) before the vast majority of 7z files can be decompressed successfully.
@Erior commented on GitHub (Feb 18, 2023):
@adamhathcock , Should we move the K_xxx defines into CMethodId.cs instead of Registry.cs ?
I see some are in both.
@Erior commented on GitHub (Feb 19, 2023):
@TraceEntertains , I would like to know if you have a test file that fails with the pull request I created. the current test contains the general setup of files used in the test suite and that passed.
@TraceEntertains commented on GitHub (Feb 19, 2023):
Both my delta test file and the original archive it was based on extracted seemingly perfectly, and the music files were the quickest to extract out of almost all other files that I could tell.
@adamhathcock commented on GitHub (Mar 1, 2023):
Thanks Erior. I've been away for personal reasons.