Skip to content

Commit

Permalink
Changed shape to not load if corrupted
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolaindjic committed Nov 29, 2024
1 parent 2d149aa commit 49cdaca
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/PhpPresentation/Reader/PowerPoint2007.php
Original file line number Diff line number Diff line change
Expand Up @@ -828,6 +828,9 @@ protected function loadShapeDrawing(XMLReader $document, DOMElement $node, Abstr
if (!empty($imageFile)) {
if ($oShape instanceof Gd) {
$info = getimagesizefromstring($imageFile);
if (!$info) {
return;
}
$oShape->setMimeType($info['mime']);
$oShape->setRenderingFunction(str_replace('/', '', $info['mime']));
$image = @imagecreatefromstring($imageFile);
Expand Down

0 comments on commit 49cdaca

Please sign in to comment.