lovasoa / dezoomify-rs

Zoomable image downloader for Google Arts & Culture, Zoomify, IIIF, and others
https://dezoomify-rs.ophir.dev
GNU General Public License v3.0
725 stars 65 forks source link

How to create custom yaml file for Motic Slides #157

Closed atultiwari closed 2 years ago

atultiwari commented 2 years ago

Hi, atul here. Few years ago I have used your script for downloading few microscopic slide image from http://122.160.116.48/Slides.aspx User id - free Password - free

In that script I was using the format like -

./dezoom.sh 189 105 "http://122.160.116.48/DSStore/code/tileHandler.ashx?Id=19110&imageId=-1&tierIndex=0&tileLevel=1&tilePositionX=%X&tilePositionY=%Y&contentType=image/jpeg&isCropped=1"`

Ref to our earlier discussion

I tried to make custom yaml file for same site so that I can try dezoomify-rs, but i am not able to figure out how to make it correctly Could you please help me out My custom yaml file -

# This is a tiles.yaml file for dezoomify-rs
# For more information about how to adapt this file to your use case, see:
# https://github.com/lovasoa/dezoomify-rs/wiki/Usage-example-for-the-custom-YAML-dezoomer

# The url of individual tiles, where {{ expressions }} will be evaluated using the variables below
url_template: "http://122.160.116.48/DSStore/code/tileHandler.ashx?Id=19110&imageId=-1&tierIndex=0&tileLevel=0&contentType=image/jpeg&isCropped=1&tilePositionX={{x}}&tilePositionY={{y}}"

# x_template and y_template tell dezoomify-rs where to place a tile on the canvas once it has been downloaded
# Here, for instance, the tile at (x=1, y=1) goes to position (256, 256)
x_template: "x * tile_size"
y_template: "y * tile_size"

variables:
  - { name: x, from: 0, to: 3 } # Image width, in tiles
  - { name: y, from: 0, to: 4 } # Image height, in tiles
  - { name: tile_size, value: 256 }

headers:
  # Specifying a Referer makes the server believe we come from that URL.
  Referer: "http://122.160.116.48/HtmlViewer.aspx?Id=19110"

# Specifying the width and height of the full image is not mandatory,
# But giving them allows dezoomify-rs to work more efficiently.
width: 186
height: 105

# The title is not mandatory either, but it makes dezoomify-rs
# create a file with an appropriate filename
title: "Beta Thal"

When I tried to run it, I got the error - "tile too large for image"

Thank you Regards, Atul

atultiwari commented 2 years ago

Update - Upon spending some time, I found my mistake. I entered values for X & Y tiles in the wrong section.

It's working after the correction. Thank you for this wonderful tool It's awesome