Convert list of manga directories to comic book archive

Suppose you have a list of manga directories i.e folders with images that have numbers as names. Although applications like MComix can read such directories without any problem, you might feel like creating a proper comic book archive using these images. Here is what I do to convert these directories to cbz files.

1. First I create separate zip files for each manga directories using following script (lets say zip.sh).

for dir in *
do
 base=$(basename "$dir")
 echo zip -j "${base}.zip" "$dir/*" >> zipcmd.sh 
done

This script creates a file called “zipcmd.sh” that lists zip commands for each file in separate line. I open this file and remove the last line (it is an anomaly that tries to convert zip.sh to a zip file). Then I run this file to create the necessary zip files.

$ sh zipcmd.sh

It creates zip files with images copied to the root of the zip file.

2. Next, I rename all the zip files to .cbz using following command

$ rename .zip .cbz *.zip

3. Now I can move all the comic book archive (cbz) files to a separate directory, so that I can cleanup the intermediary directories that I used to create the cbz file.

$ mkdir mycbz
$ mv *.cbz mycbz

You can use MComix or your favorite comic book reader application to read the archive.

About these ads

Leave a comment

Filed under Uncategorized

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s