Skip to content

Commit 9830f69

Browse files
authored
Merge pull request #143 from tingxin/fix_watermark_bug
fix bug:correct image width&height when image orientation bigger than 5
2 parents 797a3bb + 0558998 commit 9830f69

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

source/new-image-handler/src/processor/image/watermark.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -527,8 +527,7 @@ export class WatermarkAction extends BaseImageAction {
527527
function withNormalSize(metadata: sharp.Metadata): sharp.Metadata {
528528
const o = Object.assign({}, metadata);
529529
if ((metadata.orientation || 0) >= 5) {
530-
o.width = o.height;
531-
o.height = o.width;
530+
[o.width, o.height] = [o.height, o.width];
532531
}
533532
return o;
534533
}

0 commit comments

Comments
 (0)