Ensure flip and flop operations work with auto-rotate #837

This commit is contained in:
Lovell Fuller
2017-06-19 23:42:26 +01:00
parent 29354badd8
commit 49297d6afb
5 changed files with 37 additions and 2 deletions

View File

@@ -83,8 +83,11 @@ class PipelineWorker : public Nan::AsyncWorker {
VipsAngle rotation;
if (baton->useExifOrientation) {
// Rotate and flip image according to Exif orientation
// (ignore the requested rotation and flip)
std::tie(rotation, baton->flip, baton->flop) = CalculateExifRotationAndFlip(sharp::ExifOrientation(image));
bool flip;
bool flop;
std::tie(rotation, flip, flop) = CalculateExifRotationAndFlip(sharp::ExifOrientation(image));
baton->flip = baton->flip || flip;
baton->flop = baton->flop || flop;
} else {
rotation = CalculateAngleRotation(baton->angle);
}