Skip to content

Support IIIF image with query parameters when generating (thumbnail) urls

Refs https://redmine.teklia.com/issues/7163

The model method Element.iiif_thumbnail_url & Element.iiif_url should support image paths with query parameters.

Example:

  • server with url https://rhus-209.man.poznan.pl
  • image on that server with path `fcgi-bin/iipsrv.fcgi?IIIF=11/5/2020601/https___1914_1918_europeana_eu_contributions_21795/21795.258720.original.tif`
  • element on that image with polygon ((0.0, 0.0), (0.0, 672.0), (876.0, 672.0), (876.0, 0.0), (0.0, 0.0))

Both methods use urljoin which remove the query parameters. They should instead

  1. check if there is a ? in the image path
    1. no ? : use urljoin
    2. got a ?: use urljoin on the part before it
    3. then append the extra query parameters