diff --git a/src/PhpPresentation/Reader/PowerPoint2007.php b/src/PhpPresentation/Reader/PowerPoint2007.php index 939f1c4ba..d13602e57 100644 --- a/src/PhpPresentation/Reader/PowerPoint2007.php +++ b/src/PhpPresentation/Reader/PowerPoint2007.php @@ -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); @@ -1214,11 +1217,11 @@ protected function loadParagraph(XMLReader $document, DOMElement $oElement, $oSh } $oElementSpacingBefore = $document->getElement('a:spcBef/a:spcPts', $oSubElement); if ($oElementSpacingBefore instanceof DOMElement) { - $oParagraph->setSpacingBefore((int) ((int) $oElementSpacingBefore->getAttribute('val') / 100)); + $oParagraph->setSpacingBefore((int)((int)$oElementSpacingBefore->getAttribute('val') / 100)); } $oElementSpacingAfter = $document->getElement('a:spcAft/a:spcPts', $oSubElement); if ($oElementSpacingAfter instanceof DOMElement) { - $oParagraph->setSpacingAfter((int) ((int) $oElementSpacingAfter->getAttribute('val') / 100)); + $oParagraph->setSpacingAfter((int)((int)$oElementSpacingAfter->getAttribute('val') / 100)); } $oParagraph->getBulletStyle()->setBulletType(Bullet::TYPE_NONE); @@ -1404,7 +1407,7 @@ protected function loadStyleColor(XMLReader $xmlReader, DOMElement $oElement): C $oColor->setRGB($oElement->getAttribute('val')); $oElementAlpha = $xmlReader->getElement('a:alpha', $oElement); if ($oElementAlpha instanceof DOMElement && $oElementAlpha->hasAttribute('val')) { - $alpha = strtoupper(dechex((((int) $oElementAlpha->getAttribute('val') / 1000) / 100) * 255)); + $alpha = strtoupper(dechex((int)((((int)$oElementAlpha->getAttribute('val')) / 1000) / 100) * 255)); $oColor->setRGB($oElement->getAttribute('val'), $alpha); } diff --git a/src/PhpPresentation/Style/Font.php b/src/PhpPresentation/Style/Font.php index 2975df4ef..a18a9923f 100644 --- a/src/PhpPresentation/Style/Font.php +++ b/src/PhpPresentation/Style/Font.php @@ -214,10 +214,6 @@ public function getPanose(): string */ public function setPanose(string $pValue): self { - if (mb_strlen($pValue) !== 10) { - throw new InvalidParameterException('pValue', $pValue, 'The length is not equals to 10'); - } - $allowedChars = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F']; foreach (mb_str_split($pValue) as $char) { if (!in_array($char, $allowedChars)) {