diff --git a/src/PHPePub/Core/EPub.php b/src/PHPePub/Core/EPub.php index e40b82b..9ee91d5 100644 --- a/src/PHPePub/Core/EPub.php +++ b/src/PHPePub/Core/EPub.php @@ -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);