From 1663524bb09e4018f6aadbefa70bbecd108a1eea Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Sat, 6 Mar 2021 19:13:14 +0100 Subject: [PATCH] Fix notice when setCover fails to retrieve the image Signed-off-by: Kevin Decherf --- src/PHPePub/Core/EPub.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/PHPePub/Core/EPub.php b/src/PHPePub/Core/EPub.php index 39a480f..4cf18c8 100644 --- a/src/PHPePub/Core/EPub.php +++ b/src/PHPePub/Core/EPub.php @@ -1261,6 +1261,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);