Ruby + ImageMagick script to stitch Zoomify Viewer tiles into a single image at the maximum zoom level.
Give the URL of a page that contains the Zoomify Flash viewer, e.g.:
./dezoomify.rb 'http://www.christies.com/lotfinder/ZoomImage.aspx?image=/LotFinderImages/D52792/D5279274'
The file would end up in /tmp/zoomified-0.0.jpg
on Mac/*UX and C:\WINDOWS\Temp\zoomified-0.0.jpg
on Windows. (The script has yet to be confirmed to work on Windows.)
You can give multiple URLs as separate arguments:
./dezoomify.rb 'http://collections.frick.org/CUS.18.zoomobject._580$7286*1484740' 'http://collections.frick.org/CUS.18.zoomobject._1106$8983*1484996' 'http://collections.frick.org/CUS.18.zoomobject._1105$7286*1516394'
The files would end up in /tmp/zoomified-0.0.jpg
, /tmp/zoomified-1.0.jpg
and /tmp/zoomified-2.0.jpg
or the equivalent Windows directory.
The first number in the output filename reflects the ordinal of the provided URL. The second number is used if a single URL contains multiple Zoomify viewers.
Note that filenames do not increment from run to run, so beware of overwriting previously dezoomified files.
If you're on OS X, each file will be revealed in the Finder as download and stitching is completed.
Copyright (c) 2009 Henrik Nyh
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
This patch will allow this script to stitch together the tiles from a zoom level below the highest, in the event the highest zoom has a ridiculous amount of tiles.
Setting
zoom_levels_to_skip
to 1 will download and stitch the second highest zoom tiles, setting it to 2 will download and stitch 2 from the highest zoomed tiles, etc. Leaving it at 0 will obviously leave the default functionality - the highest zoom level.