lovasoa / dezoomify

Dezoomify is a web application to download zoomable images from museum websites, image galleries, and map viewers. Many different zoomable image technologies are supported.
https://dezoomify.ophir.dev
GNU General Public License v2.0
670 stars 76 forks source link

Feature request: API for dezoomify? #533

Closed gilbh closed 3 years ago

gilbh commented 3 years ago

Greetings,

Any chances to send a url and receive a PNG back via an API request (or a command-line tool)?

Thanks.

lovasoa commented 3 years ago

Running dezoomify as an API would not be free, but if you are ready to finance that, shoot me an email at contact at ophir dot dev

If you want a command-line tool, there is dezoomify-rs

gilbh commented 3 years ago

With thanks!!

gilbh commented 3 years ago

Hi Ophir,

Is dezoomify-rs engine identical to the one in the web interface? The following works fine: https://ophir.alwaysdata.net/dezoomify/dezoomify.html#http://images.eap.bl.uk/EAP673/EAP673_1_18/130.jp2/full/90,/0/default.jpg

-- and generates a valid PNG in the browser. But running the same URL using dezoomify-rs: dezoomify-rs.exe http://images.eap.bl.uk/EAP673/EAP673_1_18/130.jp2/full/90,/0/default.jpg throws the following errors:

(utils) c:\Users\Gil>dezoomify-rs.exe http://images.eap.bl.uk/EAP673/EAP673_1_18/130.jp2/full/90,/0/default.jpg
ERROR Dezoomer error: Unable to create the dezoomer: Tried all of the dezoomers, none succeeded. They returned the following errors:

 - custom: The 'custom' dezoomer cannot handle this URI
 - google_arts_and_culture: The 'google_arts_and_culture' dezoomer cannot handle this URI
 - zoomify: The 'zoomify' dezoomer cannot handle this URI
 - generic: The 'generic' dezoomer cannot handle this URI
 - pff: The 'pff' dezoomer cannot handle this URI
 - IIPImage: The 'IIPImage' dezoomer cannot handle this URI
 - nypl: The 'nypl' dezoomer cannot handle this URI
 - iiif: Unable to create the dezoomer: Invalid IIIF info.json file: expected value at line 1 column 1
 - deepzoom: Unable to create the dezoomer: Unable to parse the dzi file: Syntax: 1:1 invalid utf-8: corrupt contents
 - krpano: Unable to create the dezoomer: Unable to parse the krpano xml file: Syntax: 1:1 invalid utf-8: corrupt contents

dezoomify-rs expects a zoomable image meta-information file URL. To find this URL, you can use the dezoomify browser extension, which you can download at
- https://lovasoa.github.io/dezoomify-extension/
If this doesn't help, then your image may be in a format that is not yet supported by dezoomify-rs.
You can ask for a new format to be supported by opening a new issue on https://github.com/lovasoa/dezoomify-rs/issues

Or do I have to use the browser/browser-extension every time for the meta-information file URL?

Best Gil

lovasoa commented 3 years ago

Is dezoomify-rs engine identical to the one in the web interface?

No it's not. Please read the documentation.

In your case, the URL you want to pass to dezoomify-rs is

http://images.eap.bl.uk/EAP673/EAP673_1_18/130.jp2/info.json
lovasoa commented 3 years ago

dezoomified

gilbh commented 3 years ago

Incredible! Works great!

Thanks Ophir! Toda Raba....