mirror of
https://github.com/lovell/sharp.git
synced 2026-02-05 22:26:20 +01:00
Ensure op ordering is respected where possible #3319
Emit warnings when previous ops might be ignored Flip and flop now occur before rotate, if any
This commit is contained in:
@@ -387,6 +387,18 @@ class PipelineWorker : public Napi::AsyncWorker {
|
||||
->set("kernel", kernel));
|
||||
}
|
||||
|
||||
// Flip (mirror about Y axis)
|
||||
if (baton->flip || flip) {
|
||||
image = image.flip(VIPS_DIRECTION_VERTICAL);
|
||||
image = sharp::RemoveExifOrientation(image);
|
||||
}
|
||||
|
||||
// Flop (mirror about X axis)
|
||||
if (baton->flop || flop) {
|
||||
image = image.flip(VIPS_DIRECTION_HORIZONTAL);
|
||||
image = sharp::RemoveExifOrientation(image);
|
||||
}
|
||||
|
||||
// Rotate post-extract 90-angle
|
||||
if (!baton->rotateBeforePreExtract && rotation != VIPS_ANGLE_D0) {
|
||||
image = image.rot(rotation);
|
||||
@@ -401,18 +413,6 @@ class PipelineWorker : public Napi::AsyncWorker {
|
||||
image = sharp::RemoveExifOrientation(image);
|
||||
}
|
||||
|
||||
// Flip (mirror about Y axis)
|
||||
if (baton->flip || flip) {
|
||||
image = image.flip(VIPS_DIRECTION_VERTICAL);
|
||||
image = sharp::RemoveExifOrientation(image);
|
||||
}
|
||||
|
||||
// Flop (mirror about X axis)
|
||||
if (baton->flop || flop) {
|
||||
image = image.flip(VIPS_DIRECTION_HORIZONTAL);
|
||||
image = sharp::RemoveExifOrientation(image);
|
||||
}
|
||||
|
||||
// Join additional color channels to the image
|
||||
if (baton->joinChannelIn.size() > 0) {
|
||||
VImage joinImage;
|
||||
|
||||
Reference in New Issue
Block a user