Ensure autoOrient removes metadata after shrink-on-load #4431

This commit is contained in:
Lovell Fuller
2025-07-19 14:00:42 +01:00
parent ecfc77c185
commit 628454559e
4 changed files with 23 additions and 3 deletions

View File

@@ -98,7 +98,6 @@ class PipelineWorker : public Napi::AsyncWorker {
if (baton->input->autoOrient) {
// Rotate and flip image according to Exif orientation
std::tie(autoRotation, autoFlip, autoFlop) = CalculateExifRotationAndFlip(sharp::ExifOrientation(image));
image = sharp::RemoveExifOrientation(image);
}
rotation = CalculateAngleRotation(baton->angle);
@@ -294,6 +293,9 @@ class PipelineWorker : public Napi::AsyncWorker {
throw vips::VError("Input SVG image exceeds 32767x32767 pixel limit");
}
}
if (baton->input->autoOrient) {
image = sharp::RemoveExifOrientation(image);
}
// Any pre-shrinking may already have been done
inputWidth = image.width();