Skip to content

Commit 4ac4b73

Browse files
committed
#168 : PHPUnit fixes
1 parent f66853a commit 4ac4b73

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/PhpPresentation/Writer/ODPresentation.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,10 @@ public function save($pFilename)
247247
$imageContents = $imageZip->getFromName($imagePathSplitted[1]);
248248
$imageZip->close();
249249
unset($imageZip);
250+
} elseif (strpos($imagePath, 'data:image/') === 0) {
251+
list(, $imageContents) = explode(';', $imagePath);
252+
list(, $imageContents) = explode(',', $imageContents);
253+
$imageContents = base64_decode($imageContents);
250254
} else {
251255
$imageContents = file_get_contents($imagePath);
252256
}

src/PhpPresentation/Writer/PowerPoint2007/PptMedia.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ public function render()
2525
$imageContents = $imageZip->getFromName($imagePathSplitted[1]);
2626
$imageZip->close();
2727
unset($imageZip);
28+
} elseif (strpos($imagePath, 'data:image/') === 0) {
29+
list(, $imageContents) = explode(';', $imagePath);
30+
list(, $imageContents) = explode(',', $imageContents);
31+
$imageContents = base64_decode($imageContents);
2832
} else {
2933
$imageContents = file_get_contents($imagePath);
3034
}

0 commit comments

Comments
 (0)