diff --git a/src/Site/BlockLayout/SmartGallery.php b/src/Site/BlockLayout/SmartGallery.php index f681562..61d47b7 100644 --- a/src/Site/BlockLayout/SmartGallery.php +++ b/src/Site/BlockLayout/SmartGallery.php @@ -90,8 +90,12 @@ class SmartGallery extends AbstractBlockLayout { $mediaType = $media->mediaType(); $mediaRenderer = $media->renderer(); - if ((strpos($mediaType, 'image/') !== false) || (strpos($mediaRenderer, 'youtube') !== false)) { - array_push($images, ["media_url" => $media->originalUrl(), + if (strpos($mediaType, 'image/') !== false) { + $new_url = $media->originalUrl(); + // original files size may be very large. /large/.jpg is smaller + $new_url = substr_replace($new_url, 'jpg', strrpos($new_url, '.') +1); + $new_url = str_replace("original", "large", $new_url); + array_push($images, ["media_url" => $new_url, "item_url" => $attachment->item()->url(), "image_title" => $media->title(), "img_id" => 'gi_' . $gallery_id . '_' . $img_id, diff --git a/view/common/block-layout/smartGallery.phtml b/view/common/block-layout/smartGallery.phtml index 5b7f5b8..10dfcb1 100644 --- a/view/common/block-layout/smartGallery.phtml +++ b/view/common/block-layout/smartGallery.phtml @@ -6,6 +6,12 @@ $this->headLink()->appendStylesheet($this->assetUrl('css/style.css', ?> + +