mirror of
https://github.com/Intervention/image.git
synced 2025-08-13 17:34:04 +02:00
Normalize parameters in media type & extension encoders
This commit is contained in:
@@ -47,7 +47,7 @@ class FileExtensionEncoder extends AutoEncoder
|
||||
throw new EncoderException('No encoder found for empty file extension.');
|
||||
}
|
||||
|
||||
return match ($extension) {
|
||||
return match (strtolower($extension)) {
|
||||
'webp' => new WebpEncoder($this->quality),
|
||||
'avif' => new AvifEncoder($this->quality),
|
||||
'jpeg', 'jpg' => new JpegEncoder($this->quality),
|
||||
|
@@ -43,7 +43,7 @@ class MediaTypeEncoder implements EncoderInterface
|
||||
*/
|
||||
protected function encoderByMediaType(string $type): EncoderInterface
|
||||
{
|
||||
return match ($type) {
|
||||
return match (strtolower($type)) {
|
||||
'image/webp' => new WebpEncoder($this->quality),
|
||||
'image/avif' => new AvifEncoder($this->quality),
|
||||
'image/jpeg' => new JpegEncoder($this->quality),
|
||||
|
Reference in New Issue
Block a user