We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents cdb345f + 4d9cc36 commit f5aaf3aCopy full SHA for f5aaf3a
src/ImageResource.php
@@ -81,6 +81,9 @@ public static function createFromFile($file)
81
case IMAGETYPE_PNG:
82
$resource = imagecreatefrompng($file);
83
break;
84
+ case IMAGETYPE_WEBP:
85
+ $resource = imagecreatefromwebp($file);
86
+ break;
87
default:
88
throw new InvalidArgumentException('Unknown image file');
89
}
@@ -394,6 +397,9 @@ public function toFile($file)
394
397
$compression = static::convertJpegQualityToPngCompression(static::$quality);
395
398
imagepng($this->resource, $file, $compression);
396
399
400
401
+ imagewebp($this->resource, $file, static::$quality);
402
403
404
throw new \RuntimeException('Unknown image type');
405
0 commit comments