Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d5030a4

Browse files
committed
Use abs() for NEAREST check
Inverting the image is also ok
1 parent 83f4bc9 commit d5030a4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/_image_resample.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -879,8 +879,8 @@ void resample(
879879

880880
if (params.interpolation != NEAREST &&
881881
params.is_affine &&
882-
params.affine.sx == 1.0 &&
883-
params.affine.sy == 1.0 &&
882+
abs(params.affine.sx) == 1.0 &&
883+
abs(params.affine.sy) == 1.0 &&
884884
params.affine.shx == 0.0 &&
885885
params.affine.shy == 0.0) {
886886
params.interpolation = NEAREST;

0 commit comments

Comments
 (0)