diff --git a/docs/api-input.md b/docs/api-input.md index 55f841ed..560ed245 100644 --- a/docs/api-input.md +++ b/docs/api-input.md @@ -69,7 +69,7 @@ image const size = getNormalSize(await sharp(input).metadata()); function getNormalSize({ width, height, orientation }) { - return orientation || 0 >= 5 + return (orientation || 0) >= 5 ? { width: height, height: width } : { width, height }; } diff --git a/lib/input.js b/lib/input.js index 494d43d3..c90f7a63 100644 --- a/lib/input.js +++ b/lib/input.js @@ -357,7 +357,7 @@ function _isStreamInput () { * const size = getNormalSize(await sharp(input).metadata()); * * function getNormalSize({ width, height, orientation }) { - * return orientation || 0 >= 5 + * return (orientation || 0) >= 5 * ? { width: height, height: width } * : { width, height }; * }