Closed Miraihi closed 3 months ago
Thanks for using Caesium, the kind words and the advice! Unfortunately, supporting different archive file is a bit out of scope and might require a lot of work for a very specific use-case. Supporting .zip archives may come in the future because I also plan to use them for other features, but for .rar/.7z it might require a lot of time. I can give you a suggestion to solve your use-case: Caesium supports importing/compressing passing the list of files by command line. You can leverage this to write a mini-script (different for different operating systems) to do all the work automatically.
Let me show an example on the steps, I can get into more details if you are willing to share your configuration.
unzip comics.cbr -d destination_folder && /path/to/Caesium destination_folder && zip -r comics_compressed.cbz caesium_destination_folder
(example on Linux machines)It's not completely straightforward and requires a bit of "hacking", but it's possible. If you are on Windows, 7zip has a command line interface and I can help you come out with an automated script, if you want. I could also test it myself as what I told you is something that just came up to my mind.
Another alternative would be using caesium-clt, which is basically the same as this project, just without an UI. Would require writing a script like I said, but with less setup. The only thing is that caesium-clt it's a little bit behind in features as I lack time to maintain both projects.
Thank you for the solution. Unfortunately I don't have any experience writing batch scripts so it'll require some learning from me. I'm mostly concerned about .zip/.cbz format so that compatability alone would be great.
In the meantime I'd be satisfied with a script that unzips all the .cbz files in one folder, compresses them, and then puts the compressed .cbz files in another folder. Not sure how possible it is to automate.
This is an example using 7zip. Just tested on my machine and seems to work. Remember to setup Caesium as I wrote before before running the script.
"C:\Program Files\7-Zip\7z.exe" x -y -o"C:\Users\<your-user-name>\Pictures\MyFolder" "C:\Users\<your-user-name>\Pictures\MyFolder\auto_test.zip"
"C:\Program Files\Caesium Image Compressor\Caesium Image Compressor.exe" "C:\Users\<your-user-name>\Pictures\MyFolder\auto_test"
"C:\Program Files\7-Zip\7z.exe" a "C:\Users\<your-user-name>\Pictures\MyFolder\compressed.zip" "C:\Users\<your-user-name>\Pictures\MyFolder\caesium_destination"
If you write this into a myscript.bat
file and run it, it will uncompress C:\Users\<your-user-name>\Pictures\MyFolder\auto_test.zip
, import it to Caesium and compress (the destination folder of the compression is set into Caesium itself). Caesium will close and then 7zip will run again to compress C:\Users\<your-user-name>\Pictures\MyFolder\caesium_destination
into an archive.
It might require a little bit of tweaking, especially on 7zip parameters, depending on the comics archive structure. But should be a good starting point.
Well, after some research I've found way to implement what I want. Thanks for showing me where to start!
This batch file compresses all the .cbz files in E:\Outputs\
and puts the newly compressed versions in E:\Outputs\Compressed\
set caesium="C:\Program Files\Caesium Image Compressor\Caesium Image Compressor.exe"
set archive="C:\Program Files\7-Zip\7z.exe"
for %%f in (*.cbz) do (
mkdir "E:\Outputs\%%~nf"
%archive% x -y -o"E:\Outputs\%%~nf" "E:\Outputs\%%f"
%caesium% "E:\Outputs\%%~nf"
%archive% a -mx9 "E:\Outputs\Compressed\%%~nf.cbz" "E:\Outputs\%%~nf"
rd /s /q "E:\Outputs\%%~nf"
)
The only gripe with this script is that if there's another folder inside the source .cbz archive, it won't compress anything. In other words, it's non-recursive, and I haven't found any way to fix this (My collection is a bit of a mess and sometimes there's another folder inside the archive).
The only gripe with this script is that if there's another folder inside the source .cbz archive, it won't compress anything.
Are you referring to Caesium not importing and compressing? If you input a folder that contains only other folders, you should check the option "Import files in subfolders when opening a directory" under Preferences. That allows Caesium to recursively open directories. If it's 7zip that does not correctly unzip, or there's another zip inside, you might want to look for something like this.
Glad I helped find a solution!
If you input a folder that contains only other folders, you should check the option "Import files in subfolders when opening a directory" under Preferences
Totally forgot about that option. Thanks, worked like a charm!
Hello, Matteo. I'd like to thank you for your work on the best image converter I had pleasure using. Thanks for the "Maximum output size" feature, I haven't seen anything like that anywhere else.
What I'd love to request is the ability to compress images inside the archive. You see, the most common comic format is "cbz", what's essentially a .zip file. There are also ".cbr" and ".cb7" for ".rar" and ".7z" respectively. It'd be very convenient if I could just drag and drop the .cbz file into Caesium and get all the contents compressed, instead of unpacking, compressing, and then archiving again.