rosell-dk / webp-convert

Convert jpeg/png to webp with PHP (if at all possible)
MIT License
576 stars 101 forks source link

Gd throws FATAL on Windows if it is palette image and making it true color fails #321

Closed rosell-dk closed 2 years ago

rosell-dk commented 2 years ago

A half-working converter causes more trouble than one that doesn't work. Mark Gd as not operational if it cannot convert palette to RGB

Right now the Gd implementation is lenient when it cannot convert palette to RGB. It tries to invoke conversion even though it knows the image is palette and knows that it failed to convert to RGB. But Gd always fails in that case. And worse: On Windows, it throws FATAL