Script to convert comics for Ipod Touch (iComic app).
Friday, 25. December 2009, 19:20:04
I've been using the iComic app for my Ipod Touch to read comics. It's very nice, however CBR and CBZ comic archives usually contain very hi-res scans of the comics and are very clunky when used directly on my Ipod Touch. Resizing the images helps a lot, thus the script.
Again, it's a bash shell script for linux folk. It uses rar, unzip, and imagemagick (mogrify) to open the archive, modify the images, and create a new iComic friendly archive.
Excellent public domain comics can be found here:
Golden Age Comics
(you'll need to register on their forums before downloading)
#!/bin/bash
# expects one or more zip/rar archives of images to resize for the iphone/ipod touch
while [ "$1" ]; do
ZippedComic="$1"
ComicDir="${ZippedComic%.*}"
mkdir "$ComicDir" || exit
if file -b --mime-type "$ZippedComic"|grep zip; then
unzip -j "$ZippedComic" -d "$ComicDir"
elif file -b --mime-type "$ZippedComic"|grep rar; then
rar e "$ZippedComic" -w "$ComicDir"
else
echo "ERROR $ZippedComic not rar or zip, could not extract"
exit
fi
echo One Moment, Resizing images for ipod...
mogrify -resize x1024 "$ComicDir"/*
zip -r "$ComicDir-icomic.zip" "$ComicDir"
rm -fr "$ComicDir"
shift
done














