thephpleague / color-extractor

Extract colors from an image like a human would do.
thephpleague.com
MIT License
1.3k stars 159 forks source link

Webp image is not supported #55

Closed roelvanhintum closed 2 years ago

roelvanhintum commented 5 years ago

When feeding imagecreatefromstring a webp image, the following error occurs.

imagecreatefromstring(): Data is not in a recognized format in /var/www/html/vendor/league/color-extractor/src/League/ColorExtractor/Palette.php:54
gimler commented 3 years ago

From the php documentation http://php.adamharvey.name/manual/en/function.imagecreatefromstring.php

7.3.0 | WEBP is supported now (if supported by the libgd in use).

I have added a PR to test webp support