Skip to content

Commit 464defc

Browse files
committed
fix: missing webp images
1 parent cc4be29 commit 464defc

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Model/Display.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,12 @@ protected function isSvgImage(string $imagePath): bool
191191
protected function getBreakPointImages($imagePath, $bpWidth, $bpHeight, $resize, $format = null)
192192
{
193193
$imageUrl = $this->resize->resizeAndGetUrl($imagePath, $bpWidth, $bpHeight, $resize, $format);
194-
$html = $imageUrl;
195-
if ($this->isRetina()) {
196-
$imageUrl = $this->resize->resizeAndGetUrl($imagePath, $bpWidth * 2, $bpHeight * 2, $resize, $format);
197-
$html .= ' 1x, ' . $imageUrl . ' 2x, ';
194+
if ($imageUrl !== '') {
195+
$html = $imageUrl;
196+
if ($this->isRetina()) {
197+
$imageUrl = $this->resize->resizeAndGetUrl($imagePath, $bpWidth * 2, $bpHeight * 2, $resize, $format);
198+
$html .= ' 1x, ' . $imageUrl . ' 2x, ';
199+
}
198200
}
199201

200202
return $html;

0 commit comments

Comments
 (0)