Skip to content

Commit 94cd456

Browse files
Drop options.useExifOrientation in favor of options.input.autoOrient
1 parent 189b6e8 commit 94cd456

File tree

5 files changed

+3
-8
lines changed

5 files changed

+3
-8
lines changed

lib/constructor.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,6 @@ const Sharp = function (input, options) {
193193
canvas: 'crop',
194194
position: 0,
195195
resizeBackground: [0, 0, 0, 255],
196-
useExifOrientation: false,
197196
angle: 0,
198197
rotationAngle: 0,
199198
rotationBackground: [0, 0, 0, 255],
@@ -357,7 +356,6 @@ const Sharp = function (input, options) {
357356
}
358357
};
359358
this.options.input = this._createInputDescriptor(input, options, { allowStream: true });
360-
this.options.useExifOrientation = !!this.options.input.autoOrient;
361359
return this;
362360
};
363361
Object.setPrototypeOf(Sharp.prototype, stream.Duplex.prototype);

lib/operation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ function rotate (angle, options) {
9191
* @returns {Sharp}
9292
*/
9393
function autoOrient () {
94-
this.options.useExifOrientation = true;
94+
this.options.input.autoOrient = true;
9595
return this;
9696
}
9797

lib/resize.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ const mapFitToCanvas = {
105105
* @private
106106
*/
107107
function isRotationExpected (options) {
108-
return (options.angle % 360) !== 0 || options.useExifOrientation === true || options.rotationAngle !== 0;
108+
return (options.angle % 360) !== 0 || options.input.autoOrient === true || options.rotationAngle !== 0;
109109
}
110110

111111
/**

src/pipeline.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class PipelineWorker : public Napi::AsyncWorker {
7373
bool autoFlip = false;
7474
bool autoFlop = false;
7575

76-
if (baton->useExifOrientation) {
76+
if (baton->input->autoOrient) {
7777
// Rotate and flip image according to Exif orientation
7878
std::tie(autoRotation, autoFlip, autoFlop) = CalculateExifRotationAndFlip(sharp::ExifOrientation(image));
7979
image = sharp::RemoveExifOrientation(image);
@@ -1591,7 +1591,6 @@ Napi::Value pipeline(const Napi::CallbackInfo& info) {
15911591
baton->claheWidth = sharp::AttrAsUint32(options, "claheWidth");
15921592
baton->claheHeight = sharp::AttrAsUint32(options, "claheHeight");
15931593
baton->claheMaxSlope = sharp::AttrAsUint32(options, "claheMaxSlope");
1594-
baton->useExifOrientation = sharp::AttrAsBool(options, "useExifOrientation");
15951594
baton->angle = sharp::AttrAsInt32(options, "angle");
15961595
baton->rotationAngle = sharp::AttrAsDouble(options, "rotationAngle");
15971596
baton->rotationBackground = sharp::AttrAsVectorOfDouble(options, "rotationBackground");

src/pipeline.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ struct PipelineBaton {
107107
int claheWidth;
108108
int claheHeight;
109109
int claheMaxSlope;
110-
bool useExifOrientation;
111110
int angle;
112111
double rotationAngle;
113112
std::vector<double> rotationBackground;
@@ -279,7 +278,6 @@ struct PipelineBaton {
279278
claheWidth(0),
280279
claheHeight(0),
281280
claheMaxSlope(3),
282-
useExifOrientation(false),
283281
angle(0),
284282
rotationAngle(0.0),
285283
rotationBackground{ 0.0, 0.0, 0.0, 255.0 },

0 commit comments

Comments
 (0)