Skip to content

Commit

Permalink
Update docs for orientation method.
Browse files Browse the repository at this point in the history
  • Loading branch information
timvandijck committed Nov 3, 2023
1 parent d48373b commit 23e6b18
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
1 change: 1 addition & 0 deletions UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
18 changes: 12 additions & 6 deletions docs/image-manipulations/image-canvas.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 23e6b18

Please sign in to comment.