Skip to content

Commit

Permalink
Merge pull request #1 from wallabag/fix/notice-cover
Browse files Browse the repository at this point in the history
Fix notice when setCover fails to retrieve the image
  • Loading branch information
j0k3r authored Mar 8, 2021
2 parents b2f5e8a + 1663524 commit cf94d02
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/PHPePub/Core/EPub.php
Original file line number Diff line number Diff line change
Expand Up @@ -1260,6 +1260,9 @@ function setCoverImage($fileName, $imageData = null, $mimetype = null) {
}
}
$image = ImageHelper::getImage($this, $fileName);
if (false === $image) {
return false;
}
$imageData = $image['image'];
$mimetype = $image['mime'];
$fileName = preg_replace('#\.[^\.]+$#', "." . $image['ext'], $fileName);
Expand Down

0 comments on commit cf94d02

Please sign in to comment.