From 23e6b18db8b2ba049e33a1fe870a0dc4717789c5 Mon Sep 17 00:00:00 2001 From: Tim Van Dijck Date: Fri, 3 Nov 2023 10:12:26 +0100 Subject: [PATCH] Update docs for orientation method. --- UPGRADING.md | 1 + docs/image-manipulations/image-canvas.md | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/UPGRADING.md b/UPGRADING.md index 64a672ae..c2c92b94 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -22,3 +22,4 @@ $image = Image::useImageDriver(ImageDriver::Imagick)->load('path/to/image.jpg'); ## Other changes - The option to create a manipulations instance has been removed. - the `border` method now accepts a BorderType enum value, and it's parameters have been reordered. +- the `orientation` method now accepts a Orientation enum value. diff --git a/docs/image-manipulations/image-canvas.md b/docs/image-manipulations/image-canvas.md index 4e3efa6a..6e372433 100644 --- a/docs/image-manipulations/image-canvas.md +++ b/docs/image-manipulations/image-canvas.md @@ -41,20 +41,26 @@ The `Expand` type adds the border to the outside of the image and thus expands t ## Orientation -The `orientation` method can be used to rotate the `Image` `90`, `180` or `270` degrees. +The `orientation` method can be used to rotate the `Image` by passing a Orientation enum value. ```php -$image->orientation(Manipulations::ORIENTATION_180); +$image->orientation(Orientation::Rotate180); +``` + +When passing no parameters the orientation will be derived from the exif data of the image. + +```php +$image->orientation(); ``` ![Border](../../images/example-orientation.jpg) The accepted values are available as the following constants on the `Manipulations` class: -- `Manipulations::ORIENTATION_AUTO` (default EXIF orientation) -- `Manipulations::ORIENTATION_90` -- `Manipulations::ORIENTATION_180` -- `Manipulations::ORIENTATION_270` +- `Orientation::Rotate0` +- `Orientation::Rotate90` +- `Orientation::Rotate180` +- `Orientation::Rotate270` ## Flip