From 4d82331bf65ebf508aa085afeb31a6c12295a260 Mon Sep 17 00:00:00 2001 From: Fonger <5862369+Fonger@users.noreply.github.com> Date: Tue, 31 May 2022 15:59:15 +0800 Subject: [PATCH] docs(input): correct getNormalSize with EXIF orientation example (#3241) --- docs/api-input.md | 2 +- lib/input.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 }; * }