2020-02-11 23:10:37 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Script to properly scale generated page_#.tif files
|
|
|
|
# to your desired DPI.
|
|
|
|
|
|
|
|
#Requires ImageMagick
|
|
|
|
|
|
|
|
#Printer DPI, same as in filmless_processing.pde
|
2024-04-24 15:47:52 +00:00
|
|
|
if [[ "${1}" == "" ]]; then
|
|
|
|
echo "Please provide your DPI as your first argument"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
DPI=${1}
|
2020-02-11 23:10:37 +00:00
|
|
|
#Location of generated pages
|
2024-04-24 15:47:52 +00:00
|
|
|
PAGE_FILES="./filmless_processing/data/page_*.tif"
|
2020-02-11 23:10:37 +00:00
|
|
|
|
2020-03-01 17:45:31 +00:00
|
|
|
echo "Changing exported page files to ${DPI}dpi..."
|
2020-02-11 23:10:37 +00:00
|
|
|
|
|
|
|
for f in $PAGE_FILES
|
|
|
|
do
|
2020-03-03 23:06:28 +00:00
|
|
|
name=$(basename "$f" .tif)
|
2024-04-24 15:47:52 +00:00
|
|
|
echo "Converting ${f} to ./filmless_processing/data/${name}.png @ ${DPI}dpi..."
|
|
|
|
convert $f -units PixelsPerInch -density $DPI "./filmless_processing/data/${name}.png"
|
2020-02-11 23:10:37 +00:00
|
|
|
done
|