Allow seq read for EXIF-based auto-orient #3725

This commit is contained in:
Lovell Fuller
2023-07-09 09:26:58 +01:00
parent 38c760cdd7
commit 2f67823c3d
2 changed files with 6 additions and 1 deletions

View File

@@ -79,6 +79,9 @@ class PipelineWorker : public Napi::AsyncWorker {
// Rotate and flip image according to Exif orientation
std::tie(autoRotation, autoFlip, autoFlop) = CalculateExifRotationAndFlip(sharp::ExifOrientation(image));
image = sharp::RemoveExifOrientation(image);
if (baton->input->access == VIPS_ACCESS_SEQUENTIAL && (autoRotation != VIPS_ANGLE_D0 || autoFlip)) {
image = image.copy_memory();
}
} else {
rotation = CalculateAngleRotation(baton->angle);
}
@@ -1676,7 +1679,6 @@ Napi::Value pipeline(const Napi::CallbackInfo& info) {
baton->angle != 0 ||
baton->rotationAngle != 0.0 ||
baton->tileAngle != 0 ||
baton->useExifOrientation ||
baton->flip ||
baton->claheWidth != 0 ||
!baton->affineMatrix.empty()