Last active
October 13, 2019 15:01
-
-
Save kmlawson/7ea611531554eeba1526e98c89e17f2b to your computer and use it in GitHub Desktop.
Creates a simple command line interface to openseadragon, making use of dezoom.sh
This file contains 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
# This is a wrapper for: https://github.com/lovasoa/dezoom.sh | |
# Running that command can be tedious if you have a regular URL pattern from openSeaDragon, | |
# such as the NLA format: https://nla.gov.au/[some image id]/dzi?tile=14/44_38.jpg | |
# Running this will prompt you for the url pointing to the highest X_Y tile and will | |
# then construct the appropriate dezoom.sh command using -X and -Y parameters | |
# it assumes you have wget and ImageMagick installed, and that the dezoom.sh file | |
# is in the same directory. | |
echo Paste in the highest tile on zoom level 14: | |
read fullurl | |
myx=`echo $fullurl | sed 's/.*14\/\([0-9]\{1,2\}\).*/\1/'` | |
myy=`echo $fullurl | sed 's/.*14\/[0-9]\{1,2\}_\([0-9]\{1,2\}\).*/\1/'` | |
newurl=`echo $fullurl | sed 's/\(.*14\/\)[0-9]\{1,2\}_[0-9]\{1,2\}.*/\1%X_%Y.jpg/'` | |
echo Updated URL: | |
echo $newurl | |
echo Highest X tile: | |
echo $myx | |
echo Highest Y tile: | |
echo $myy | |
echo Running dezoomify... | |
`./dezoom.sh -X $myx -Y $myy "$newurl"` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment