Last active
October 30, 2019 21:46
-
-
Save IReese/220313568c7c34401867f5362f56d4b8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
FILE_IN=$1 | |
TILE_NUM=$2 | |
file_name=$( basename $FILE_IN | sed 's/.tif//' ) | |
function tiff_dims() { | |
EXTENT=$(tiffinfo "$1" | grep 'Image Width:' | sed 's/Image Width://' | sed 's/Image Length://' ) | |
echo -n "$EXTENT" | |
} | |
ExtractedExtent=$(tiff_dims "${FILE_IN}") | |
#echo $ExtractedExtent | |
set -- $ExtractedExtent | |
pix_wide=$1 | |
pix_high=$2 | |
width_extract=$( bc <<< ''$pix_wide'/'$TILE_NUM'' ) | |
height_extract=$( bc <<< ''$pix_high'/'$TILE_NUM'' ) | |
echo "$pix_wide" | |
echo "$pix_high" | |
echo "$width_extract" | |
echo "$height_extract" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment