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

@ -19,6 +19,9 @@ Requires libvips v8.14.2
* Prevent over-compute in affine-based rotate before resize.
[#3722](https://github.com/lovell/sharp/issues/3722)
* Allow sequential read for EXIF-based auto-orientation.
[#3725](https://github.com/lovell/sharp/issues/3725)
### v0.32.1 - 27th April 2023
* Add experimental `unflatten` operation.

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()