Running Debian Sid with mcomix 1.01, I attempted to open a .tar.xz file containing several large .tif images.
.tif images are supported, so the only answer I can come to is that mcomix is not seeing them.
The archive in question has a copyrighted work in high resolution (a manga scan), so I don't think it's wise to upload it here. I created the archive with tar cJf archive.tar.xz *.tif
.
To get a sense of scale, each TIF is about 12 megabytes in size. They open fine outside of the tarball.
I do have p7zip-full and xz-utils installed, so I'm not sure where the problem comes from. Nothing is printed to the console when I attempt to open the tarball. I have opened the archive in a hex editor and the header matches the definition for a .XZ file perfectly.
The problem is Python 2
tarfile
module does not have support for LZMA:Yes, and I looked at the code, it uses 7-zip for decompressing them.
This should not be an issue.
And as I said, I got no errors on the console. It was not using
tarfile
when it failed.The header in the .xz file is 0xFD followed by '7zXZ', as described in
archive_tools.py
.Last edit: Wyatt Ward 2016-01-26
Indeed, except in my case the listing output of 7z is different than for the regular case, which is why MComix think the archive is empty. Can you copy/paste the output of
7z l -slt archive.tar.xz
?I can predict before I try it that it will not unpack the tarball inside - it will turn the
.tar.xz
into a normal.tar
file.Anyway, here's the output.
Is it not handling the secondary '.tar' unpacking, perhaps? Might it need to be differentiated from a normal 'SEVENZIP' file and carry an additional step?
Unpacking it with
7z x 'Jitsu Wa Chapter 109 raw.tar.xz'
unpacks a.tar
file, not the images in the tarball.Last edit: Wyatt Ward 2016-01-26
No, again the problem is the listing is different: no 'Path = Jitsu Wa Chapter 109 raw.tar' line. Secondary unpacking is correctly handled if it's a regular 7z archive.
I compressed it with GNU tar in the format of
tar cJf tarball.tar.xz *.tif
.By the way, I just tried it again by first making a normal, non-compressed
.tar
and then runningxz -z Jitsu\ Wa\ Chapter\ 109 raw.tar
on it.The output from
7z -slt
is the same. This is just how xz-utils'xz
program works.Looks like maybe a different method (LZMA:24) but otherwise identical.
If anything, the problem looks to be that it expects all '.xz' archives to have been made by 7-zip instead of by the original program.
EDIT
made a .xz archive with
7z a -txz
and it has the same issue. I think you might have to usesevenzip
nested inside oftarfile
's decompression function to get the files out, perhaps.Still pretty sure the major change is that a separate use case needs to exist for
.tar.xz
archives than for.7z
ones. even if both get unpacked partway withsevenzip
.Last edit: Wyatt Ward 2016-01-26
The problem is 7z output is inconsistent with other type of archives.
So of course this is causing issues with the parsing code. IMHO it's a bug with 7z, as we don't know how the archive member will be named, e.g. if it does not end in
.tar.xz
:no; 7z archives are not able to contain streams like
xz
archives, so that makes perfect sense. 'xz' sees these things differently.quoting Igor Pavlov from here:
https://sourceforge.net/p/sevenzip/discussion/45797/thread/920f3324/
Last edit: Wyatt Ward 2016-01-26
Also, why is
-slt
necessary?It works fine without it.
7z l Jitsu\ Wa\ Chapter\ 109 raw.tar.xz
I fail to see how this is relevant. Check the output without
-slt
: the archive member is correctly named. We need this name when we ask 7z to extract the entry.I'm trying to suggest solutions, not find more problems.
but in the case of a
.tar.xz
file, it's a safer assumption that if it has thexz
header it's going to behave like a compressed data stream. If you need a filename, the tarball will be the only file inside.7z x -txz -si -so < 'Jitsu Wa Chapter 109 raw.tar.xz' > tarball.tar
is a (bash/linux) command line that will extract the file to a tarball namedtarball.tar
that can then be unpacked or listed manually.on windows, I don't have a computer immediately available but I believe this will work:
type "Jitsu Wa Chapter 109 raw.tar.xz" | 7z.exe x -txz -si -so > tarball.tar
Last edit: Wyatt Ward 2016-01-26
That's the problem, the need to add a special case because 7z output is not consistent, which I consider again a bug.
I don't know why we're still discussing, honestly, since it seems we're on the same page of it being a bug.
In 7z or in MComix? ;P
Anyway, I'm looking into it.
-slt
is necessary for supporting some things, like detecting if the archive is solid, better encryption support, etc...Why do you need to know if the archive is solid if all you're going to do is decompress it? And BTW, all
.tar.*
files are solid.tar
is a solid block of data.Also,
xz
does NOT support encryption, so that's of no concern.The code is not just there just to support tar archives... Yes, in this particular case it's solid, and not encrypted...
Fix here.
@Benoit Pierre: Thanks for the fix, it seems to work. Please push it to SVN.
Fix pushed to SVN.