jalcaldea / 7z-stream

7z-stream is a streaming 7z parser.
MIT License
5 stars 3 forks source link

LZMA2 Algorithm it's not yet implemented #2

Closed markb-trustifi closed 4 years ago

markb-trustifi commented 4 years ago

Is there a chance that the LZMA2 will be implemented?

jalcaldea commented 4 years ago

Currently, the development of the project has not been followed, but I encourage you to try. Any improvement is always welcome. ;)

markb-trustifi commented 4 years ago

I added bounty to this issue: https://www.bountysource.com/issues/85157674-lzma2-algorithm-it-s-not-yet-implemented

It should be JS only solution, integrated to this library that receives buffer and returns back buffer as other implemented methods. The file for tests (inside zip) is:

1324myCCDOCX.7z.zip

ferion11 commented 4 years ago

I have looked on the code and made some tests. Maybe this will help:

I wish you all good luck

markb-trustifi commented 4 years ago

The LZMA library seams to be broken. There are a lot of issues and I also constantly get this error:

Error: corrupted input
    at $init_0 (.../node_modules/lzma/src/lzma_worker.js:313:19)

https://github.com/LZMA-JS/LZMA-JS/issues/54

markb-trustifi commented 4 years ago

Thank you for the update! But the solution is not ready yet. This file check.7z.zip throws error: LZMA2 control byte 2 is unsupported!

I see, some information about the byte 2 is here, if it can help: https://github.com/ulikunitz/xz/blob/master/doc/LZMA2.md#chunks

lesderid commented 4 years ago

@markb-trustifi Yes, I looked into this, but sadly this can't be fixed without changes to lzma-purejs, or duplicating some of its functionality here, because lzma-purejs doesn't currently allow for partial LZMA state resets and dictionary resets (because it's not used in LZMA1).

The second option should not be too complex, I'll look into it when I have some time.

markb-trustifi commented 4 years ago

@jalcaldea can I have the commandline arguments that create 7Z archive with and without "byte 2"? Now I'm using: 7z a -m1=LZMA2 archive.7z file.docx

lesderid commented 4 years ago

@markb-trustifi From my tests, it should be able to read archives made with 7z a -m0=LZMA2 archive.7z file.

markb-trustifi commented 4 years ago

@jalcaldea I see sometimes it creates archive with method "LZMA2:14" (it works) and sometimes with methods like "LZMA2:96k", "LZMA2:384k", ... (these don't work). Is this parameter relevant?

lesderid commented 4 years ago

@markb-trustifi I've opened a new issue for this: https://github.com/jalcaldea/7z-stream/issues/5. If you could post any test files there that would be very helpful.