Skip to content

Create Twig Extensions for IIIF Image API IDs (and URL) and for JMESPATH evaluation #127

@DiegoPino

Description

@DiegoPino

What is this?

Two helper Twig extensions for our own need and users

  • IIIF ID generator. Right now we are using our knowledge and data to build manually those IIIF Image API URLs. Used for IIIF manifests, Media serving, downloads, etc. That works and won't be deprecated but it would be easier if one could call a Twig Function with arguments that get that consistently generated.
  • JMESPATH. Imagine you could get the list of PDFs that have more than 10 pages in a single call? Specially during manifest generation. Or all annotation with "comment" motivation. A simple wrapper function that also catches syntax errors and logs them instead of making user's life a hell would be great. E.g
"as:image".*|[?"dr:for"=='images' && "dr:mimetype"== 'image/jpeg' ]|[?"flv:exif".ImageWidth!='null']

Which will only fetch JPEGS uploaded to "images" where there is and actual ImageWidth

Metadata

Metadata

Assignees

Labels

TwigTwig template processingenhancementNew feature or request

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions