Skip to content

Commit

Permalink
fix: missing webp images
Browse files Browse the repository at this point in the history
  • Loading branch information
kpitn committed Feb 28, 2024
1 parent cc4be29 commit 464defc
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Model/Display.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,12 @@ protected function isSvgImage(string $imagePath): bool
protected function getBreakPointImages($imagePath, $bpWidth, $bpHeight, $resize, $format = null)
{
$imageUrl = $this->resize->resizeAndGetUrl($imagePath, $bpWidth, $bpHeight, $resize, $format);
$html = $imageUrl;
if ($this->isRetina()) {
$imageUrl = $this->resize->resizeAndGetUrl($imagePath, $bpWidth * 2, $bpHeight * 2, $resize, $format);
$html .= ' 1x, ' . $imageUrl . ' 2x, ';
if ($imageUrl !== '') {
$html = $imageUrl;
if ($this->isRetina()) {
$imageUrl = $this->resize->resizeAndGetUrl($imagePath, $bpWidth * 2, $bpHeight * 2, $resize, $format);
$html .= ' 1x, ' . $imageUrl . ' 2x, ';
}
}

return $html;
Expand Down

0 comments on commit 464defc

Please sign in to comment.