Created
May 14, 2012 10:47
-
-
Save theirix/2693265 to your computer and use it in GitHub Desktop.
Convert TIFFs to a DJVu file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
DJVUPATH=/usr/local/djvulibre/bin/ | |
djvuname=$1 | |
shift | |
for file in $* ; do | |
base=`echo $file | sed 's/\.[^\.]*$//'` | |
djvus="$djvus $base.djvu" | |
ppms="$ppms $base.ppm" | |
echo $base ... | |
convert $file $base.ppm | |
$DJVUPATH/cpaldjvu $base.ppm $base.djvu | |
done | |
[ ! -f "$djvuname" ] || exit 1 | |
echo Merging to $djvuname ... | |
$DJVUPATH/djvm -c $djvuname $djvus | |
rm -f $djvus $ppms |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment