Skip to content

Commit

Permalink
Fix reader issue image size
Browse files Browse the repository at this point in the history
  • Loading branch information
mr9d committed Jan 21, 2024
1 parent 1ca0684 commit 563c013
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Layout/Common/Component/LazyImage/LazyImage.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,14 @@ public function render(): void

private function renderNormal()
{
$style = 'aspect-ratio: calc(' . $this->width .' / ' . $this->height .'); max-width: ' . $this->width . 'px';

echo '<img ' .
'src="' . $this->src . '" ' .
'width="' . $this->width . '" ' .
'height="' . $this->height . '" ' .
'alt="' . $this->alt . '" ' .
'style="' . $style . '" ' .
($this->class !== null ? 'class="' . $this->class . '" ' : '') .
$this->otherAttributesString() .
'>';
Expand Down

0 comments on commit 563c013

Please sign in to comment.