mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 18:40:16 +02:00
Docs: clarify which axis is used when mirroring
This commit is contained in:
parent
5255964c79
commit
e873978e53
@ -57,7 +57,8 @@ const resizeThenRotate = await sharp(input)
|
|||||||
|
|
||||||
|
|
||||||
## flip
|
## flip
|
||||||
Flip the image about the vertical Y axis. This always occurs before rotation, if any.
|
Mirror the image vertically (up-down) about the x-axis.
|
||||||
|
This always occurs before rotation, if any.
|
||||||
The use of `flip` implies the removal of the EXIF `Orientation` tag, if any.
|
The use of `flip` implies the removal of the EXIF `Orientation` tag, if any.
|
||||||
|
|
||||||
|
|
||||||
@ -73,7 +74,8 @@ const output = await sharp(input).flip().toBuffer();
|
|||||||
|
|
||||||
|
|
||||||
## flop
|
## flop
|
||||||
Flop the image about the horizontal X axis. This always occurs before rotation, if any.
|
Mirror the image horizontally (left-right) about the y-axis.
|
||||||
|
This always occurs before rotation, if any.
|
||||||
The use of `flop` implies the removal of the EXIF `Orientation` tag, if any.
|
The use of `flop` implies the removal of the EXIF `Orientation` tag, if any.
|
||||||
|
|
||||||
|
|
||||||
|
File diff suppressed because one or more lines are too long
@ -80,7 +80,8 @@ function rotate (angle, options) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Flip the image about the vertical Y axis. This always occurs before rotation, if any.
|
* Mirror the image vertically (up-down) about the x-axis.
|
||||||
|
* This always occurs before rotation, if any.
|
||||||
* The use of `flip` implies the removal of the EXIF `Orientation` tag, if any.
|
* The use of `flip` implies the removal of the EXIF `Orientation` tag, if any.
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
@ -95,7 +96,8 @@ function flip (flip) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Flop the image about the horizontal X axis. This always occurs before rotation, if any.
|
* Mirror the image horizontally (left-right) about the y-axis.
|
||||||
|
* This always occurs before rotation, if any.
|
||||||
* The use of `flop` implies the removal of the EXIF `Orientation` tag, if any.
|
* The use of `flop` implies the removal of the EXIF `Orientation` tag, if any.
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
|
@ -380,11 +380,11 @@ class PipelineWorker : public Napi::AsyncWorker {
|
|||||||
if (autoRotation != VIPS_ANGLE_D0) {
|
if (autoRotation != VIPS_ANGLE_D0) {
|
||||||
image = image.rot(autoRotation);
|
image = image.rot(autoRotation);
|
||||||
}
|
}
|
||||||
// Flip (mirror about Y axis)
|
// Mirror vertically (up-down) about the x-axis
|
||||||
if (baton->flip || autoFlip) {
|
if (baton->flip || autoFlip) {
|
||||||
image = image.flip(VIPS_DIRECTION_VERTICAL);
|
image = image.flip(VIPS_DIRECTION_VERTICAL);
|
||||||
}
|
}
|
||||||
// Flop (mirror about X axis)
|
// Mirror horizontally (left-right) about the y-axis
|
||||||
if (baton->flop || autoFlop) {
|
if (baton->flop || autoFlop) {
|
||||||
image = image.flip(VIPS_DIRECTION_HORIZONTAL);
|
image = image.flip(VIPS_DIRECTION_HORIZONTAL);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user