File tree Expand file tree Collapse file tree
lib/private/Blurhash/Listener Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -67,23 +67,11 @@ public function handle(Event $event): void {
6767 return ;
6868 }
6969
70- $ image = false ;
71- try {
72- // using preview image to generate the blurhash
73- $ preview = $ this ->preview ->getPreview ($ file , 256 , 256 );
74- $ image = @imagecreatefromstring ($ preview ->getContent ());
75- } catch (NotFoundException $ e ) {
76- // https://github.com/nextcloud/server/blob/9d70fd3e64b60a316a03fb2b237891380c310c58/lib/private/legacy/OC_Image.php#L668
77- // The preview system can fail on huge picture, in that case we use our own image resizer.
78- if (str_starts_with ($ file ->getMimetype (), 'image/ ' )) {
79- $ image = $ this ->resizedImageFromFile ($ file );
80- }
81- }
82-
83- if ($ image === false ) {
70+ if (!str_starts_with ($ file ->getMimetype (), 'image/ ' )) {
8471 return ;
8572 }
8673
74+ $ image = $ this ->resizedImageFromFile ($ file );
8775 $ metadata ->setString ('blurhash ' , $ this ->generateBlurHash ($ image ))
8876 ->setEtag ('blurhash ' , $ currentEtag );
8977 }
You can’t perform that action at this time.
0 commit comments