Princeton-CDH / derrida-django

Derrida's Margins - Python/Django web application
https://derridas-margins.princeton.edu
Apache License 2.0
8 stars 1 forks source link

create mapping list for proxy iiif images in the archive site #290

Closed rlskoeser closed 2 years ago

rlskoeser commented 2 years ago

Rather than archive all the iiif or limit ourselves to iiif image zero, I'd like to configure nginx to proxy the iiif images used for the deep zoom (and referenced in the intervention dataset export). I think we should be able to use an nginx map file for this — something like this example: https://stackoverflow.com/a/40576333

To do that, we need to generate the list for the mapfile.

The URLs we care about for this look like this: https://derridas-margins.princeton.edu/library/aristotle-organon-categories-de-linterpretation-1959/gallery/images/p-77/iiif/0,0,4096,4096/512,/0/default.jpg

Everything after /iiif/ can be ignored (proxied as is).

We need the slug for the book and the short id for the page image, e.g. p-77 (or, maybe just the whole url from /library/ up through /iiif/) ; and then we need the image url that it should resolve to.

We only need urls for images associated with works have digital editions and are public on the site.

This does not need to be replicable or require checked in code; if I were doing it I might use queryset logic or similar in python console and just document on this issue (or a gist if large enough) what logic was used in case we need to check or revise it.

kmcelwee commented 2 years ago

what images are served out

Get these from all instances with digital editions, and use annotated_pages, insertion_images, and overview_images

FROM
/library/levi-strauss-anthropologie-structurale-1958/gallery/images/front-cover/iiif/*

TO
https://iiif-cloud.princeton.edu/iiif/2/ee%2F01%2F85%2Fee01854d72144395b12e49ce512bce02%2Fintermediate_file

/library/levi-strauss-anthropologie-structurale-1958/gallery/images/front-cover/iiif/* https://iiif-cloud.princeton.edu/iiif/2/ee%2F01%2F2Fee01854d72144395b12e49ce512bce02%2Fintermediate_file;

CanvasImageByPageNumber Associated with a digital edition

kmcelwee commented 2 years ago

Script that can be executed in the derrida-django shell to generate mapfile: https://gist.github.com/kmcelwee/4de37dd3ebad4fcad3d06a1d1670086a