0
Answered

Recommended settings to use when creating CBZ files?

Tom Davies 9 years ago updated by Tom 6 years ago 10

I ran into a strange problem today. I converted a large number of my comic files from CBR to CBZ using 7-zip. I un-rar-ed the files to folders, then zipped them back up using these settings:

7z a -mx0 -mmt4 my_new_comic_file.cbz *.*

a = archive

mx0 = no compression

mmt4 = use all 4 CPU cores


After I zipped up all my files and deleted the old CBRs, I rescanned the folder tree with Ubooquity. It processed the files but many of my newly zipped CBZs were not recognized. When I checked the Ubooquity log, I found errors like this one:


20160125 11:02:15 [Scanner thread] WARN com.ubooquity.f.a - Failed to read file, will try to guess format: M:\eBooks\Comics\Azrael\Azrael v2\Azrael v2 #003.cbz
20160125 11:02:15 [Scanner thread] WARN com.ubooquity.f.a - Failed to guess file format


This happened to a couple hundred files. I went to the specific file and opened it and read it in another reader/viewer (Honeyview), and I couldn't see anything wrong with it. I opened ComicRack and rescanned my folders and the comics showed up fine in ComicRack. Just because I couldn't think of anything else to try I had ComicRack convert the files to CBZ (even though they were already CBZ files). It took a while, but when it was finished, I rescanned with Ubooquity and all bad files comics were fixed.


That leads me to assume that whatever settings that I'm using when I manually zip the files aren't good for Ubooquity. So my question is, what settings should I use? I have a mess more CBRs to convert.


Thanks,
Tom


Searching answer

That's strange indeed. In theory Ubooquity should be able to read any zip file, regardless of the settings you used.

I have been using 7zip myself to convert cbr to cbz for years without any problem. I'll have to take a look at may settings.


When Ubooquity fails to open a file and tries to guess its format, it uses "magic numbers". Ubooquity not able to recognize a zip file would mean that the header of the file is not a standard one. Quite strange.


Could you provide me one of your faulty files so that I can analyze it ?

I'll also try to reproduce the problem on my side with your 7z settings.


Unfortunately, when ComicRack rezipped the files, it deletes the old ones. I did find one file that Ubooquity didn't like even after ComicRack rezipped it. Here's a link to the file in my Dropbox:

https://www.dropbox.com/s/skltsfb455sqhxw/Sensation%20Comics%20%23016%20%281943%29.cbz?dl=0

I can't see anything wrong with the file, but Ubooquity shows it with a blank cover and when you attempt to read it, it says "no page found".

Answered

Thanks, got it.

This file is of type "7z", not "zip". Ubooquity cannot open it.


I looked at my own 7z options; you have to specify the output format, otherwise 7zip will produce 7z files.

This is done using the "-t" switch (e.g. "-tzip" to produce zip files).




Thanks for sorting that out for me. I feel kind dumb for not realizing that myself!

It happens to everybody. :)

Can you allow 7-zip compressed files to be scanned and rendered. I have several cbr files that has 7-zip compression.

Last time I checked (one or two years ago), there was no usable Java libraries that allowed 7-zip file extraction.

Some progress seems to have been made since then, I'll take a look at the available libraries and add 7-zip support if they work well enough.


By the way, the correct extension for 7-zip compressed files is "cb7", not "cbr". "cbr" is for RAR compressed files.

I did some tests, the current pure Java libraries for 7zip management (namely Apache Commons Compress with XZ) are still too slow to be integrated.

Sorry.

A little late to the party, but I'm trying out ubooquity (VERY well done, btw), and I have a similar issue.
I get.
com.github.junrar.exception.RarException: notRarArchive
I can open it with evince 3.30.2.
Seems to only happen with cbr files, not cbz.

RAR support is not perfect in Ubooquity: it relies on a library (Junrar) that is quite old and has a few issues. But it's the only one available for Java.

Apparently, Junrar development has been active again in the past few month, so hopefully the situation will improve in the future.