Skip to content

Commit 649707e

Browse files
committed
fix(Classifier): fix unexpected false return value
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
1 parent 9d62e38 commit 649707e

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎lib/Classifiers/Classifier.php‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,9 @@ public function generatePreviewWithProvider(File $file): string {
358358
*/
359359
public function generatePreviewWithGD(string $path): string {
360360
$image = imagecreatefromstring(file_get_contents($path));
361+
if (!$image) {
362+
throw new \OCA\Recognize\Exception\Exception('Could not load image for preview with gdlib');
363+
}
361364
$width = imagesx($image);
362365
$height = imagesy($image);
363366

0 commit comments

Comments
 (0)