MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Kobo Reader (https://www.mobileread.com/forums/forumdisplay.php?f=223)
-   -   Comic optimizer script (https://www.mobileread.com/forums/showthread.php?t=196258)

rhon 11-08-2012 07:04 PM

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



All times are GMT -4. The time now is 08:27 PM.

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.