mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Add support for non lower case extensions with toFormat
This commit is contained in:
@@ -188,7 +188,7 @@ function withMetadata (options) {
|
||||
* @throws {Error} unsupported format or options
|
||||
*/
|
||||
function toFormat (format, options) {
|
||||
const actualFormat = formats.get(is.object(format) && is.string(format.id) ? format.id : format);
|
||||
const actualFormat = formats.get((is.object(format) && is.string(format.id) ? format.id : format).toLowerCase());
|
||||
if (!actualFormat) {
|
||||
throw is.invalidParameterError('format', `one of: ${[...formats.keys()].join(', ')}`, format);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user