Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 45 lines (38 sloc) 1.75 KB
# Creates the sample images for Quack from originals.
# This script is only relevant if the caller has access
# to the original scanned files. These are not stored
# with the Quack code as their cumulative size is 34MB.
# Contact Toke Eskildsen - if
# the originals are of interest.
# Requires bash & GraphicsMagick
COMMAND="-geometry 40%x -level 0,1.0,220 -quality 55 -type Grayscale"
FROM_TO="AdresseContoirsEfterretninger-1795-06-16-02-0018B,ACE-17950616-0018B AdresseContoirsEfterretninger-1795-06-16-02-0019A,ACE-17950616-0019A AdresseContoirsEfterretninger-1795-06-16-02-0019B,ACE-17950616-0019B"
# We would like samples from other time periods, but only the 200+ years
# old ones are currently cleared for distribution.
#FROM_TO="AdressecomptoirsEfterretninger-1846-01-20-01-0029A,ACE-18460120-0029A AdressecomptoirsEfterretninger-1846-01-20-01-0031B,ACE-18460120-0031A AdresseContoirsEfterretninger-1795-06-16-02-0018B,ACE-17950616-0018B"
if [ ! -d $ORIGINALS ]; then
echo "The originals folder $ORIGINALS does not exist."
if [ ! "te" == `whoami` ]; then
echo "The user name `whoami` indicates you are not Toke Eskildsen."
echo "This implies that you do not have the originals used to regenerate the samples."
echo "Please ensure that the originals are available at ${ORIGINALS}."
exit 2
if [ ! -d $SAMPLES ]; then
mkdir $SAMPLES
for FT in $FROM_TO; do
SRC=`echo "$FT" | cut -d, -f1`
DEST=`echo "$FT" | cut -d, -f2`
echo "Generating sample from ${SRC} to ${DEST}"
gm convert ${ORIGINALS}/${SRC}.png $COMMAND ${SAMPLES}/${DEST}.jpg
cp ${ORIGINALS}/${SRC}.alto.xml ${SAMPLES}/${DEST}.alto.xml
echo "Done"