1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-19 04:01:30 +02:00

Add named quality parameter in FileExtensionEncoder

This commit is contained in:
Oliver Vogel
2024-01-12 09:17:32 +01:00
parent 284fbff79b
commit 96cc73f175

View File

@@ -49,14 +49,14 @@ class FileExtensionEncoder extends AutoEncoder
}
return match (strtolower($extension)) {
'webp' => new WebpEncoder($this->quality),
'avif' => new AvifEncoder($this->quality),
'jpeg', 'jpg' => new JpegEncoder($this->quality),
'webp' => new WebpEncoder(quality: $this->quality),
'avif' => new AvifEncoder(quality: $this->quality),
'jpeg', 'jpg' => new JpegEncoder(quality: $this->quality),
'bmp' => new BmpEncoder(),
'gif' => new GifEncoder(),
'png' => new PngEncoder(),
'tiff', 'tif' => new TiffEncoder($this->quality),
'jp2', 'j2k', 'jpf', 'jpm', 'jpg2', 'j2c', 'jpc', 'jpx' => new Jpeg2000Encoder($this->quality),
'tiff', 'tif' => new TiffEncoder(quality: $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 . ').'),
};
}