Skip to content

Commit abde77f

Browse files
alexcarter404patrickbrouwers
authored andcommitted
Fixed HtmlReader to align images correctly when inserted using (SpartnerNL#1252)
1 parent 79564b5 commit abde77f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Maatwebsite/Excel/Readers/HtmlReader.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ protected function insertImageBySrc($sheet, $column, $row, $attributes)
757757
$drawing->setWorksheet($sheet);
758758
$drawing->setCoordinates($column . $row);
759759
$drawing->setResizeProportional();
760-
$drawing->setOffsetX($drawing->getWidth() - $drawing->getWidth() / 5);
760+
$drawing->setOffsetX(0);
761761
$drawing->setOffsetY(10);
762762

763763
// Set height and width
@@ -768,8 +768,8 @@ protected function insertImageBySrc($sheet, $column, $row, $attributes)
768768
$drawing->setHeight($height);
769769

770770
// Set cell width based on image
771-
$this->parseWidth($sheet, $column, $row, $drawing->getWidth() / 3);
772-
$this->parseHeight($sheet, $column, $row, $drawing->getHeight());
771+
$this->parseWidth($sheet, $column, $row, $drawing->getWidth() / 6);
772+
$this->parseHeight($sheet, $column, $row, $drawing->getHeight() * 0.9);
773773
}
774774

775775
/**

0 commit comments

Comments
 (0)