diff --git a/php_image_magician.php b/php_image_magician.php index a582cbb..9ff0d28 100755 --- a/php_image_magician.php +++ b/php_image_magician.php @@ -2376,6 +2376,9 @@ private function openImage($file) case '.psd': $img = @$this->imagecreatefrompsd($file); break; + case '.webp': + $img = @imagecreatefromwebp($file); + break; // ... etc @@ -2475,7 +2478,13 @@ public function saveImage($savePath, $imageQuality="100") case '.bmp': file_put_contents($savePath, $this->GD2BMPstring($this->imageResized)); break; - + case '.webp': + $this->checkInterlaceImage($this->isInterlace); + if (imagetypes() & IMG_WEBP) { + imagewebp($this->imageResized, $savePath, $imageQuality); + }else{ + $error = 'webp'; + } // ... etc default: