View Single Post
Old 11-08-2012, 06:04 PM   #1
rhon
Junior Member
rhon began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Nov 2012
Device: Kobo Touch
Comic optimizer script

Hi !

I've recently bought a Kobo Touch, and I've made a little script based on 7z and imagemagick to optimize comic scanlation for Kobo.

I hope it could help somebody. It takes comic archive as argument, and should work on any Linux distribution with 7zip and imagemagick installed.

When the script have finished , a new comic archive is created with -kobo suffix.

Code:
#!/bin/sh

TOLERANCE=4%
JPG_QUALITY=75
SIZE=600x800
TMP_DIR=/tmp/koboTest
INPUT_COMIC_TYPE=.cbr

rm -rf $TMP_DIR
mkdir $TMP_DIR
7z e "$1" -o$TMP_DIR

for i in $TMP_DIR/*
do
    convert "$i" -fuzz $TOLERANCE -quality $JPG_QUALITY -resize $SIZE -trim +repage -colorspace gray "$i"
done

7z a -tzip -w$TMP_DIR "`basename "$1" $INPUT_COMIC_TYPE`"-kobo.cbz $TMP_DIR/*
rm -rf $TMP_DIR
rhon is offline   Reply With Quote