mirror of
https://github.com/Intervention/image.git
synced 2025-08-20 12:41:23 +02:00
Add named quality parameter in FileExtensionEncoder
This commit is contained in:
@@ -49,14 +49,14 @@ class FileExtensionEncoder extends AutoEncoder
|
|||||||
}
|
}
|
||||||
|
|
||||||
return match (strtolower($extension)) {
|
return match (strtolower($extension)) {
|
||||||
'webp' => new WebpEncoder($this->quality),
|
'webp' => new WebpEncoder(quality: $this->quality),
|
||||||
'avif' => new AvifEncoder($this->quality),
|
'avif' => new AvifEncoder(quality: $this->quality),
|
||||||
'jpeg', 'jpg' => new JpegEncoder($this->quality),
|
'jpeg', 'jpg' => new JpegEncoder(quality: $this->quality),
|
||||||
'bmp' => new BmpEncoder(),
|
'bmp' => new BmpEncoder(),
|
||||||
'gif' => new GifEncoder(),
|
'gif' => new GifEncoder(),
|
||||||
'png' => new PngEncoder(),
|
'png' => new PngEncoder(),
|
||||||
'tiff', 'tif' => new TiffEncoder($this->quality),
|
'tiff', 'tif' => new TiffEncoder(quality: $this->quality),
|
||||||
'jp2', 'j2k', 'jpf', 'jpm', 'jpg2', 'j2c', 'jpc', 'jpx' => new Jpeg2000Encoder($this->quality),
|
'jp2', 'j2k', 'jpf', 'jpm', 'jpg2', 'j2c', 'jpc', 'jpx' => new Jpeg2000Encoder(quality: $this->quality),
|
||||||
default => throw new EncoderException('No encoder found for file extension (' . $extension . ').'),
|
default => throw new EncoderException('No encoder found for file extension (' . $extension . ').'),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user