claviska / SimpleImage

A PHP class that makes working with images and GD as simple as possible.
MIT License
1.38k stars 382 forks source link

Webp not supported #271

Closed Mxater closed 3 years ago

Mxater commented 3 years ago

This is not soported.

In line 131

        // Get image info
        $info = getimagesize($file);
        if($info === false) {
            throw new \Exception("Invalid image file: $file", self::ERR_INVALID_IMAGE);
        }
        $this->mimeType = $info['mime'];

This throw false, because getimagesize dont support webp https://www.php.net/manual/es/function.getimagesize.php With WEBP images, show false Exception.

I tested in PHP 7.0 and 7.3

173

claviska commented 3 years ago

webp was added to getimagesize() in 7.1.0 per the PHP docs. It isn't expected to work in 7.0 but should be working in 7.3 if your version of PHP/gd has webp enabled.