-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unsupported compression type 'L4' #10
Comments
Yep thanks for the issue! LZ4 is on the todo list, but I have never worked with ROOT files using that compression, so it was not a high priority. With your file, I can now have a look but in principle it should be fairly easy, since luckily most of the compression codecs in Julia are based on https://github.com/JuliaIO/TranscodingStreams.jl which means that the API is the same! |
I forgot, could you upload a small sample of that file @bernd1995 ? |
Of course.
|
Perfect, thanks! |
I tried out my first idea yesterday, to just add the package https://github.com/JuliaIO/CodecLz4.jl and in the function if String(compression_header.algo) == "ZL"
stream = IOBuffer(read(ZlibDecompressorStream(io), tkey.fObjlen))
elseif String(compression_header.algo) == "L4"
stream = IOBuffer(read(LZ4SafeDecompressorStream(io),tkey.fObjlen))
else
error("Unsupported compression type '$(String(compression_header.algo))'")
end However, it seems that there is some different behavior in the f=ROOTFile("/hosts/nashome/riederer_bernd/test_comp.root")
ERROR: LZ4_decompress_safe_continue: Decompression failed.
Stacktrace:
[1] changemode!(::TranscodingStreams.TranscodingStream{LZ4SafeDecompressor,IOStream}, ::Symbol) at /hosts/nashome/riederer_bernd/.julia/packages/TranscodingStreams/MsN8d/src/stream.jl:717
[2] callprocess(::TranscodingStreams.TranscodingStream{LZ4SafeDecompressor,IOStream}, ::TranscodingStreams.Buffer, ::TranscodingStreams.Buffer) at /hosts/nashome/riederer_bernd/.julia/packages/TranscodingStreams/MsN8d/src/stream.jl:649
[3] fillbuffer(::TranscodingStreams.TranscodingStream{LZ4SafeDecompressor,IOStream}; eager::Bool) at /hosts/nashome/riederer_bernd/.julia/packages/TranscodingStreams/MsN8d/src/stream.jl:577
[4] fillbuffer at /hosts/nashome/riederer_bernd/.julia/packages/TranscodingStreams/MsN8d/src/stream.jl:564 [inlined]
[5] eof(::TranscodingStreams.TranscodingStream{LZ4SafeDecompressor,IOStream}) at /hosts/nashome/riederer_bernd/.julia/packages/TranscodingStreams/MsN8d/src/stream.jl:188
[6] readbytes!(::TranscodingStreams.TranscodingStream{LZ4SafeDecompressor,IOStream}, ::Array{UInt8,1}, ::Int32) at /hosts/nashome/riederer_bernd/.julia/packages/TranscodingStreams/MsN8d/src/stream.jl:371
[7] read(::TranscodingStreams.TranscodingStream{LZ4SafeDecompressor,IOStream}, ::Int32) at ./io.jl:941
[8] UnROOT.Streamers(::IOStream) at /hosts/nashome/riederer_bernd/.julia/dev/UnROOT/src/streamers.jl:87
[9] ROOTFile(::String) at /hosts/nashome/riederer_bernd/.julia/dev/UnROOT/src/root.jl:39
[10] top-level scope at none:1 |
Thanks for the efforts Bernd! Yes I spent two hours yesterday and also could not decompress it. The LZ4 algorithm requires also the uncompressed size, as far as I understood so I also had to pass I'll dig deeper today. Btw. the compression part needs to be tweaked anyways since currently it's more or less hardcoded to a single algorithm. For this I played around with a new struct to make it easier, but it's not finished yet. |
Btw. here is the line which I meant: https://github.com/tamasgal/UnROOT.jl/blob/edb08617293e2f248439e40e4952793ada2e16cd/src/streamers.jl#L89 However it does not work yet, as mentioned 😉 |
I guess I will simply dump the raw uncompressed data as a binary file and then fire up the hex editor to inspect it. Additionally I'll also try other LZ4 decompressor libraries (e.g. in Python) to see if it's maybe a problem in |
to be clear, you still can't read data yet, *I think it is because baskets in branch are interlaced with stuff that are not compressed by LZ4 (ROOT's stuff? Tamas can tell me how does that work). For posterity, LZ4, in block mode, needs to know how long the data is after decompression. AND, there's a |
Ah ok, sorry for the confusion, at least we have big first leap ;) I'll check it out! |
Hey nice work still 😃 |
nvm, I got it working, pushing now! |
oh wow 😆 |
I just ran into another error message:
The ROOT-File I am trying to read was created with
ROOT v6.14/00
and the settings for File creation wereThe following lines were obtained from this file using the ROOT-CLI
I guess the program is either catching my case even though it should not be a problem for
ZlibDecompressorStream()
to read my files. In my opinion this should be the case since all my files with lower Compression-Levels were read without a problem.If this is not the case however it could maybe be fixed by adding another decompreesion-package like CodecLz4.jl.
The text was updated successfully, but these errors were encountered: