Skip to content

Instantly share code, notes, and snippets.

@pgmccann
Created May 27, 2016 09:03
Show Gist options
  • Save pgmccann/210e9efa7ae3985d2497b5d1a162cb2d to your computer and use it in GitHub Desktop.
Save pgmccann/210e9efa7ae3985d2497b5d1a162cb2d to your computer and use it in GitHub Desktop.
Create single DjVu file from TIFFs
#!/bin/bash
function make_page_djvu {
i=$1
j=`basename $i .tif`
convert $i $j.jpg
c44 $j.jpg $j.djvu
if [ -f UYLY205-2.djvu ]; then
djvm -i UYLY205-2.djvu $j.djvu
else
cp $j.djvu UYLY205-2.djvu
fi
}
for n in `seq 1 9`
do
make_page_djvu "UYLY205-2_0000$n.TIF"
done
for n in `seq 10 99`
do
make_page_djvu "UYLY205-2_000$n.TIF"
done
for n in `seq 100 188`
do
make_page_djvu "UYLY205-2_00$n.TIF"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment