Skip to content

Commit

Permalink
959 Use image dimension properties in IIIF Manifest if they exist… (#969
Browse files Browse the repository at this point in the history
)

* 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.
  • Loading branch information
alxp authored Aug 16, 2023
1 parent 11afd42 commit 71f0945
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,12 @@ protected function getTileSourceFromRow(ResultRow $row, $iiif_address, $iiif_bas
* 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);
Expand Down

0 comments on commit 71f0945

Please sign in to comment.