Skip to content

Commit

Permalink
Merge pull request #44705 from nextcloud/fix/issue-44702
Browse files Browse the repository at this point in the history
fix(Blurhash): Suppress imagecreatefromstring() E_WARNING
  • Loading branch information
joshtrichards authored Apr 8, 2024
2 parents e108534 + e02a060 commit ff2100a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/private/Blurhash/Listener/GenerateBlurhashMetadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public function handle(Event $event): void {
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.
Expand All @@ -114,7 +114,7 @@ public function handle(Event $event): void {
* @throws LockedException
*/
private function resizedImageFromFile(File $file): GdImage|false {
$image = imagecreatefromstring($file->getContent());
$image = @imagecreatefromstring($file->getContent());
if ($image === false) {
return false;
}
Expand Down

0 comments on commit ff2100a

Please sign in to comment.