Skip to content

Commit

Permalink
Merge pull request PHPOffice#1794 from ErnestStaug/image_conversion_s…
Browse files Browse the repository at this point in the history
…upport

Added support for "cloudConvert" images
  • Loading branch information
troosan authored Jul 7, 2020
2 parents 250e206 + fa0ba2e commit 21f4bb3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/PhpWord/Reader/Word2007/AbstractPart.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,10 @@ protected function readRunChild(XMLReader $xmlReader, \DOMElement $node, Abstrac

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

0 comments on commit 21f4bb3

Please sign in to comment.