Skip to content

Instantly share code, notes, and snippets.

@joswr1ght
Created July 29, 2020 16:22
Show Gist options
  • Save joswr1ght/d91eed54b3fdc9ea8011023672e9f7e9 to your computer and use it in GitHub Desktop.
Save joswr1ght/d91eed54b3fdc9ea8011023672e9f7e9 to your computer and use it in GitHub Desktop.
Convert one or more TIFF files in the current directory to resized JPGs
#!/bin/bash
if [ $? -eq 1 ] ; then
echo "Usage: $0 <save-dir> [long-edge-in-px]"
exit
fi
for image in *.tif; do
base=`echo $image | sed 's/.tif//'`
convert $image -resize "$2>" $1/$base-$1.jpg >>log 2>&1
echo -n "."
done
echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment