Skip to content

Commit

Permalink
#37 fixing an error when image link has no extension.
Browse files Browse the repository at this point in the history
  • Loading branch information
Grandt committed Mar 16, 2016
1 parent 05d3090 commit 09f343c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/PHPePub/Core/EPub.php
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,8 @@ protected function resolveImage($source, &$internalPath, &$internalSrc, &$isSour
}
if ($imageData !== false) {
$iSrcInfo = pathinfo($internalSrc);
if (!empty($imageData['ext']) && $imageData['ext'] != $iSrcInfo['extension']) {

if (!empty($imageData['ext']) && (!isset($iSrcInfo['extension']) || $imageData['ext'] != $iSrcInfo['extension'])) {
$internalSrc = $iSrcInfo['filename'] . "." . $imageData['ext'];
}
$internalPath = RelativePath::getRelativePath("images/" . $internalPath . "/" . $internalSrc);
Expand Down

0 comments on commit 09f343c

Please sign in to comment.