Closed
Description
This is:
- a bug report
What is the expected behavior?
I need a Excel file with a few images on it.
What is the current behavior?
If i draw multiple images, the excel file could not be opened.
What are the steps to reproduce?
$mysql->query('SELECT * FROM fruits');
$fruits = $mysql->resultset();
$column = "A";
$nextRow = 0;
$titleRow = 7;
$picRow = 8;
$priceDRow = 9;
$priceRow = 10;
$remarkRow = 11;
for ($i=0; $i < sizeof($fruits); $i++)
{
addImage(__DIR__ .'/upload/'.$fruits[$i]["Image"],$column.$picRow, 100, $spreadsheet->getActiveSheet());
if($column == "A"){
$column = "B";
}else if($column == "B"){
$column = "C";
}else if($column == "C"){
$column = "D";
}else if($column == "D"){
$titleRow += 5;
$picRow += 5;
$priceDRow += 5;
$priceRow += 5;
$remarkRow += 5;
$column = "A";
}
}
function addImage($path, $coordinates, $height, $sheet){
$drawing = new Drawing();
$drawing->setPath($path);
$drawing->setHeight($height);
$drawing->setCoordinates($coordinates);
$drawing->setWorksheet($sheet);
}
Which versions of PhpSpreadsheet and PHP are affected?
Latest Version (1.8)