Skip to content

Commit

Permalink
Add jpeg200 extensions & media types to encoders
Browse files Browse the repository at this point in the history
  • Loading branch information
olivervogel committed Dec 23, 2023
1 parent 4e72c5c commit 03aa19c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Encoders/FileExtensionEncoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ protected function encoderByFileExtension(?string $extension): EncoderInterface
'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 . ').'),
};
}
Expand Down
1 change: 1 addition & 0 deletions src/Encoders/MediaTypeEncoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ protected function encoderByMediaType(string $type): 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 . ').'),
};
}
Expand Down

0 comments on commit 03aa19c

Please sign in to comment.