zimeon / iiif

IIIF Image API reference implementation and Python library
GNU General Public License v3.0
55 stars 15 forks source link

Add option to generate extra static files in iiif_static.py #29

Closed zimeon closed 7 years ago

zimeon commented 7 years ago

It would be nice to be able to generate specific thumbnails or other derivatives in addition to the normal set of static tiles. Should have syntax like:

iiif_static.py ...params... --extra='/full/90,/0/default.jpg' --extra='/0,0,10,10/full/90/default.png' img.jpg

For cases where region is full, size is w,h and rotation is 0 then the w,h size should also be added to sizes in the info.json.

zimeon commented 7 years ago

Fixed:

(py3) simeon@Cider ~> iiif_static.py --extra='/0,0,10,10/20,20/90/default.png' a.jpg 
iiif_static.py: source file: a.jpg
iiif.static: Output directory /tmp/a already exists, adding/updating files
iiif.static: /tmp / a/0,0,512,512/512,/0/default.jpg
...
iiif.static: /tmp / a/full/1,1 -> a/full/1,
iiif.static: /tmp / a/0,0,10,10/20,20/90/default.png
iiif.static: /tmp / a/info.json
(py3) simeon@Cider ~> file /tmp/a/0,0,10,10/20,20/90/default.png
/tmp/a/0,0,10,10/20,20/90/default.png: PNG image data, 20 x 20, 8-bit/color RGB, non-interlaced