Browse Source

959 Use image dimension properties in IIIF Manifest if they exist… (#969)

* 959-use-image-dimensions Use image dimension properties if they exist when generating IIIF manifests.

959-use-image-dimensions Address PHPCS error.

959-use-image-dimensions Address PHPCS error.

* 959-use-image-dimensions Make image dimension values numeric per the spec.
953-hocr-media-updated 2.8.3
Alexander O'Neill 1 year ago committed by GitHub
parent
commit
71f0945e3c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      modules/islandora_iiif/src/Plugin/views/style/IIIFManifest.php

6
modules/islandora_iiif/src/Plugin/views/style/IIIFManifest.php

@ -313,6 +313,12 @@ class IIIFManifest extends StylePluginBase {
* The width and height of the image.
*/
protected function getCanvasDimensions(string $iiif_url, FieldItemInterface $image, string $mime_type) {
if (isset($image->width) && is_numeric($image->width)
&& isset($image->height) && is_numeric($image->height)) {
return [intval($image->width), intval($image->height)];
}
try {
$info_json = $this->httpClient->get($iiif_url)->getBody();
$resource = json_decode($info_json, TRUE);

Loading…
Cancel
Save