Browse Source

Merge pull request #916 from rosiel/fix-iiif

Fix errors when OCR field not set.
pull/922/head
Jordan Dukart 2 years ago committed by GitHub
parent
commit
5472f6d7e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      modules/islandora_iiif/src/Plugin/views/style/IIIFManifest.php

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

@ -205,11 +205,13 @@ class IIIFManifest extends StylePluginBase {
continue;
}
if (!is_null($ocrField)) {
$ocrs = $entity->{$ocrField->definition['field_name']};
$ocr = isset($ocrs[$i]) ? $ocrs[$i] : FALSE;
}
// Create the IIIF URL for this file
// Visiting $iiif_url will resolve to the info.json for the image.
$ocr = isset($ocrs[$i]) ? $ocrs[$i] : FALSE;
$file_url = $image->entity->createFileUrl(FALSE);
$mime_type = $image->entity->getMimeType();
$iiif_url = rtrim($iiif_address, '/') . '/' . urlencode($file_url);

Loading…
Cancel
Save