Skip to content

Instantly share code, notes, and snippets.

@dellsystem
Created April 6, 2011 17:48
Show Gist options
  • Save dellsystem/906125 to your computer and use it in GitHub Desktop.
Save dellsystem/906125 to your computer and use it in GitHub Desktop.
converting tifs to pyramidal tiffs
#!/usr/bin/env bash
# A bash script for converting all the files in a directory to pyramidal tiff
# Pass the directory the images are stored in as an argument
# But it will put the images in the current directory ... to be fixed
if [ $# -lt 3 ]; then
echo 'Usage: tile <directory> <extension> <desired_prefix>'
else
echo 'Looking for all files in directory: $1/'
FILES=$1/*.$2
i=1
for file in $FILES
do
echo "Processing $file file ..."
convert="vips im_vips2tiff $file $3_$i.tif:none,tile:256x256,pyramid"
echo $convert
echo `$convert`
i=$(( $i + 1 )) # ...bash
# break
done
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment