diff --git a/services/Helpers/PortableInfoboxRenderServiceHelper.php b/services/Helpers/PortableInfoboxRenderServiceHelper.php index 82c4b01..a172ff4 100644 --- a/services/Helpers/PortableInfoboxRenderServiceHelper.php +++ b/services/Helpers/PortableInfoboxRenderServiceHelper.php @@ -72,7 +72,11 @@ class PortableInfoboxRenderServiceHelper { 'width' => round( $dimensions[ 'width' ] * $ratio ), 'height' => round( $dimensions[ 'height' ] * $ratio ) ] ); - if ( !$thumbnail || $thumbnail->isError() ) { + $thumbnail2x = $file->transform( [ + 'width' => round( $dimensions[ 'width' ] * $ratio * 2 ), + 'height' => round( $dimensions[ 'height' ] * $ratio * 2 ) + ] ); + if ( !$thumbnail || $thumbnail->isError() || !$thumbnail2x || $thumbnail2x->isError() ) { return false; } $ref = null; @@ -84,6 +88,7 @@ class PortableInfoboxRenderServiceHelper { 'height' => $dimensions[ 'height' ], 'width' => $dimensions[ 'width' ], 'thumbnail' => $thumbnail->getUrl(), + 'thumbnail2x' => $thumbnail2x->getUrl(), 'key' => urlencode( $data[ 'key' ] ), 'media-type' => $data[ 'isVideo' ] ? 'video' : 'image', 'mercuryComponentAttrs' => json_encode( [ diff --git a/templates/PortableInfoboxItemImage.mustache b/templates/PortableInfoboxItemImage.mustache index 90eff05..b10e582 100644 --- a/templates/PortableInfoboxItemImage.mustache +++ b/templates/PortableInfoboxItemImage.mustache @@ -5,7 +5,7 @@
- {{alt}} {{#isVideo}} {{#duration}}