renders original image when displaying deepzoom images

This commit is contained in:
buttle 2022-03-15 18:33:18 +01:00
parent 01a30c9ace
commit 1fb0d8c91d
1 changed files with 6 additions and 1 deletions

View File

@ -75,13 +75,18 @@ class ImageViewer extends AbstractBlockLayout
static $id = 0; static $id = 0;
$media = $attachments[0]->item()->media()[0]; $media = $attachments[0]->item()->media()[0];
if ($block->dataValue('zoom_type') == "wheelzoom") {
$image_url = $media->originalUrl();
} else {
$image_url = $media->primaryMedia()->thumbnailUrl('large');
}
return $view->partial('common/block-layout/imageViewer', [ return $view->partial('common/block-layout/imageViewer', [
'zoom_type' => $block->dataValue('zoom_type'), 'zoom_type' => $block->dataValue('zoom_type'),
'title' => $block->dataValue('title'), 'title' => $block->dataValue('title'),
'item_url' => $attachments[0]->item()->url(), 'item_url' => $attachments[0]->item()->url(),
'renderSourceLink' => $block->dataValue('renderSourceLink'), 'renderSourceLink' => $block->dataValue('renderSourceLink'),
'width' => $block->dataValue('width'), 'width' => $block->dataValue('width'),
'image' => $media->primaryMedia()->thumbnailUrl('large'), 'image' => $image_url,
'id' => 'iv-' . ++$id, 'id' => 'iv-' . ++$id,
]); ]);
} }