Skip to content

Commit 445844c

Browse files
authored
Merge pull request #1 from ErnestStaug/image_conversion_support
Added support for cloud convert image inclusion
2 parents 733f845 + fa0ba2e commit 445844c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/PhpWord/Reader/Word2007/AbstractPart.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,10 @@ protected function readRunChild(XMLReader $xmlReader, \DOMElement $node, Abstrac
270270

271271
$name = $xmlReader->getAttribute('name', $node, 'wp:inline/a:graphic/a:graphicData/pic:pic/pic:nvPicPr/pic:cNvPr');
272272
$embedId = $xmlReader->getAttribute('r:embed', $node, 'wp:inline/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:blip');
273+
if ($name === null && $embedId === null) { // some Converters puts images on a different path
274+
$name = $xmlReader->getAttribute('name', $node, 'wp:anchor/a:graphic/a:graphicData/pic:pic/pic:nvPicPr/pic:cNvPr');
275+
$embedId = $xmlReader->getAttribute('r:embed', $node, 'wp:anchor/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:blip');
276+
}
273277
$target = $this->getMediaTarget($docPart, $embedId);
274278
if (!is_null($target)) {
275279
$imageSource = "zip://{$this->docFile}#{$target}";

0 commit comments

Comments
 (0)