docs(input): correct getNormalSize with EXIF orientation example (#3241)

This commit is contained in:
Fonger 2022-05-31 15:59:15 +08:00 committed by GitHub
parent b91875d3d9
commit 4d82331bf6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -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 };
}

View File

@ -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 };
* }