Skip to content

Commit

Permalink
Add named quality parameter in FileExtensionEncoder
Browse files Browse the repository at this point in the history
  • Loading branch information
olivervogel committed Jan 12, 2024
1 parent 284fbff commit 96cc73f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Encoders/FileExtensionEncoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ protected function encoderByFileExtension(?string $extension): EncoderInterface
}

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 . ').'),
};
}
Expand Down

0 comments on commit 96cc73f

Please sign in to comment.