mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 15:25:07 +01:00
Add toFormat 'jpg' alias for 'jpeg' (#814)
This commit is contained in:
@@ -274,6 +274,7 @@ function toFormat (format, options) {
|
||||
if (is.object(format) && is.string(format.id)) {
|
||||
format = format.id;
|
||||
}
|
||||
if (format === 'jpg') format = 'jpeg';
|
||||
if (!is.inArray(format, ['jpeg', 'png', 'webp', 'tiff', 'raw'])) {
|
||||
throw new Error('Unsupported output format ' + format);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user