Skip to content

Commit

Permalink
FIXED : #29 : Sample_04_InMemoryImage.php
Browse files Browse the repository at this point in the history
  • Loading branch information
Progi1984 committed Jul 1, 2014
1 parent bc5eae9 commit 886eb53
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/PhpPowerpoint/Writer/ODPresentation/Content.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
use PhpOffice\PhpPowerpoint\Shared\Drawing as SharedDrawing;
use PhpOffice\PhpPowerpoint\Shared\XMLWriter;
use PhpOffice\PhpPowerpoint\Style\Alignment;
use PhpOffice\PhpPowerpoint\Shape\MemoryDrawing;

/**
* \PhpOffice\PhpPowerpoint\Writer\ODPresentation\Content
Expand Down Expand Up @@ -330,7 +331,7 @@ public function writeContent(PHPPowerPoint $pPHPPowerPoint = null)
$this->_writeChart($objWriter, $shape, $shapeId);
}
*/
} elseif ($shape instanceof Drawing) {
} elseif ($shape instanceof AbstractDrawing) {
$this->writePic($objWriter, $shape, $shapeId);
}
}
Expand Down Expand Up @@ -365,7 +366,11 @@ public function writePic(XMLWriter $objWriter, AbstractDrawing $shape, $shapeId)
}
// draw:image
$objWriter->startElement('draw:image');
$objWriter->writeAttribute('xlink:href', 'Pictures/' . md5($shape->getPath()) . '.' . $shape->getExtension());
if($shape instanceof Drawing){
$objWriter->writeAttribute('xlink:href', 'Pictures/' . md5($shape->getPath()) . '.' . $shape->getExtension());
} elseif($shape instanceof MemoryDrawing){
$objWriter->writeAttribute('xlink:href', 'Pictures/' . $shape->getIndexedFilename());
}
$objWriter->writeAttribute('xlink:type', 'simple');
$objWriter->writeAttribute('xlink:show', 'embed');
$objWriter->writeAttribute('xlink:actuate', 'onLoad');
Expand Down

0 comments on commit 886eb53

Please sign in to comment.