fix(GenerateBlurhashMetadata): Suppress imagescale errors

Suppress errors in imagescale during file-scans:
Most of these errors are caused by out of range x/y-dims.

Triggering un unhandled exception, metadata-generation aborts at this point  (e.g. occ files:scan --generate-metadata), effectively preventing these images from being added to photos or maps.

This problem might be the root cause for an issue described here:
https://github.com/nextcloud/photos/issues/2768

Signed-off-by: umgfoin <umgfoin@users.noreply.github.com>
This commit is contained in:
umgfoin 2025-03-12 12:22:49 +01:00
parent cebff0b389
commit b3b2c68937

View file

@ -98,7 +98,7 @@ class GenerateBlurhashMetadata implements IEventListener {
$newX = intval($currX * $newY / $currY);
}
$newImage = imagescale($image, $newX, $newY);
$newImage = @imagescale($image, $newX, $newY);
return ($newImage !== false) ? $newImage : $image;
}