ArthurHoaro / web-thumbnailer

PHP library which will retrieve a thumbnail for any given URL
MIT License
22 stars 1 forks source link

error type given #29

Closed agentcobra closed 3 years ago

agentcobra commented 4 years ago

I use v2.0.3 in shaarli and get this error when refreshing thumbnails:

[Thu Nov 05 18:34:21.146472 2020] [php7:notice] [pid 29009] [client 172.17.20.1:38716] TypeError: Argument 1 passed to WebThumbnailer\\Utils\\ImageUtils::isImageString() must be of the type string, bool given, called in /var/www/shaarli.agentcobra.net/vendor/arthurhoaro/web-thumbnailer/src/WebThumbnailer/Finder/DefaultFinder.php on line 59, referer: https://shaarli.agentcobra.net/admin/thumbnails

it referer to : https://github.com/ArthurHoaro/web-thumbnailer/blob/39bfd4f3136d9e6096496b9720e877326cfe4775/src/WebThumbnailer/Finder/DefaultFinder.php#L59 function definition is here : https://github.com/ArthurHoaro/web-thumbnailer/blob/39bfd4f3136d9e6096496b9720e877326cfe4775/src/WebThumbnailer/Utils/ImageUtils.php#L177


I use:

agentcobra commented 3 years ago

ping @ArthurHoaro

ArthurHoaro commented 3 years ago

Sorry for the very late answer. Thanks for the very clear report :+1:

This can happen if the remote content could not be retrieved. I'll send a PR to fix this and add proper checks before calling this method.