1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-13 17:34:04 +02:00

Add jpeg200 extensions & media types to encoders

This commit is contained in:
Oliver Vogel
2023-12-23 10:18:18 +01:00
parent 4e72c5c5c1
commit 03aa19cac4
2 changed files with 2 additions and 0 deletions

View File

@@ -55,6 +55,7 @@ class FileExtensionEncoder extends AutoEncoder
'gif' => new GifEncoder(),
'png' => new PngEncoder(),
'tiff', 'tif' => new TiffEncoder($this->quality),
'jp2', 'j2k', 'jpf', 'jpm', 'jpg2', 'j2c', 'jpc', 'jpx' => new Jpeg2000Encoder($this->quality),
default => throw new EncoderException('No encoder found for file extension (' . $extension . ').'),
};
}

View File

@@ -51,6 +51,7 @@ class MediaTypeEncoder implements EncoderInterface
'image/gif' => new GifEncoder(),
'image/png' => new PngEncoder(),
'image/tiff' => new TiffEncoder($this->quality),
'image/jp2', 'image/jpx', 'image/jpm' => new Jpeg2000Encoder($this->quality),
default => throw new EncoderException('No encoder found for media type (' . $type . ').'),
};
}