mirror of
https://github.com/nextcloud/server.git
synced 2026-06-07 15:53:04 -04:00
fix(Blurhash): Suppress imagecreatefromstring() E_WARNING
We're already checking return value to determine if the format is unrecognized. There's no reason to let imagecreatefromstring() generate it's own E_WARNING when the format is unrecognized. Fixes #44702 Signed-off-by: Josh <josh.t.richards@gmail.com>
This commit is contained in:
parent
bad51ef63b
commit
fc1a83f3de
1 changed files with 2 additions and 2 deletions
|
|
@ -88,7 +88,7 @@ class GenerateBlurhashMetadata implements IEventListener {
|
|||
try {
|
||||
// using preview image to generate the blurhash
|
||||
$preview = $this->preview->getPreview($file, 256, 256);
|
||||
$image = imagecreatefromstring($preview->getContent());
|
||||
$image = @imagecreatefromstring($preview->getContent());
|
||||
} catch (NotFoundException $e) {
|
||||
// https://github.com/nextcloud/server/blob/9d70fd3e64b60a316a03fb2b237891380c310c58/lib/private/legacy/OC_Image.php#L668
|
||||
// The preview system can fail on huge picture, in that case we use our own image resizer.
|
||||
|
|
@ -114,7 +114,7 @@ class GenerateBlurhashMetadata implements IEventListener {
|
|||
* @throws LockedException
|
||||
*/
|
||||
private function resizedImageFromFile(File $file): GdImage|false {
|
||||
$image = imagecreatefromstring($file->getContent());
|
||||
$image = @imagecreatefromstring($file->getContent());
|
||||
if ($image === false) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue