From 23863c348e3583701c9777f904a997595a779263 Mon Sep 17 00:00:00 2001 From: Scott Kidder Date: Wed, 17 Jan 2018 15:10:19 -0800 Subject: [PATCH] Fixes #225 by correcting the flip and flop directions --- resizer.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/resizer.go b/resizer.go index ddd4127..98a95ae 100644 --- a/resizer.go +++ b/resizer.go @@ -291,7 +291,6 @@ func extractOrEmbedImage(image *C.VipsImage, o Options) (*C.VipsImage, error) { func rotateAndFlipImage(image *C.VipsImage, o Options) (*C.VipsImage, bool, error) { var err error var rotated bool - var direction Direction = -1 if o.NoAutoRotate == false { rotation, flip := calculateRotationAndFlip(image, o.Rotate) @@ -309,16 +308,14 @@ func rotateAndFlipImage(image *C.VipsImage, o Options) (*C.VipsImage, bool, erro } if o.Flip { - direction = Horizontal - } else if o.Flop { - direction = Vertical + rotated = true + image, err = vipsFlip(image, Vertical) } - if direction != -1 { + if o.Flop { rotated = true - image, err = vipsFlip(image, direction) + image, err = vipsFlip(image, Horizontal) } - return image, rotated, err }