GMImage.SetEXIFOrientation
--------------------------

Sets orientation for EXIF.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [GraphicsMagick](component_GraphicsMagick.md) | [6.5](newinversion65.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "GMImage.SetEXIFOrientation"; ImageRef; Orientation ) 

**MBS**( **"GMImage.SetEXIFOrientation";** /\* Sets orientation for EXIF. \*/  
**$ImageRef**; /\* The image reference number.e.g. 1 \*/   
**$Orientation**) /\* The orientation value.e.g. 1 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| ImageRef | The image reference number. | 1 |
| Orientation | The orientation value. | 1 |

### Result

Returns OK or error.

### Description

Sets orientation for EXIF.  
Changing orientation may need to set orientation via [GMImage.SetOrientation](GMImageSetOrientation.md) and GMImage.SetEXIFOrientation. With a JPEG you have orientation both in JPEG header and in EXIF metadata.  
  
| Name | Value | Description |
|---|---|---|
| UndefinedOrientation | 0 | Unknown |
| TopLeftOrientation | 1 | Line direction: Left to right, Frame Direction: Top to bottom |
| TopRightOrientation | 2 | Line direction: Right to left, Frame Direction: Top to bottom |
| BottomRightOrientation | 3 | Line direction: Right to left, Frame Direction: Bottom to top |
| BottomLeftOrientation | 4 | Line direction: Left to right, Frame Direction: Bottom to top |
| LeftTopOrientation | 5 | Line direction: Top to bottom, Frame Direction: Left to right |
| RightTopOrientation | 6 | Line direction: Top to bottom, Frame Direction: Right to left |
| RightBottomOrientation | 7 | Line direction: Bottom to top, Frame Direction: Right to left |
| LeftBottomOrientation | 8 | Line direction: Bottom to top, Frame Direction: Left to right |

### See also

- [GMImage.GetEXIFOrientation](GMImageGetEXIFOrientation.md)
- [GMImage.GetOrientation](GMImageGetOrientation.md)
- [GMImage.SetOrientation](GMImageSetOrientation.md)

### Release notes

- **Version 9.5**
    - Fixed range check in [GMImage.SetEXIFOrientation](http://www.mbsplugins.eu/GMImageSetEXIFOrientation.shtml).

### Example Databases

- [GraphicsMagick/Correct Image Orientation](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/GraphicsMagick/Correct%20Image%20Orientation.shtml#1ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 9.5pr4](https://www.mbsplugins.de/archive/2019-10-21/MBS_FileMaker_Plugin_version_9/monkeybreadsoftware_blog_filemaker)
- [Correct Image Orientation in FileMaker](https://www.mbsplugins.de/archive/2018-11-09/Correct_Image_Orientation_in_F/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 6.5pr9](https://www.mbsplugins.de/archive/2016-12-05/MBS_FileMaker_Plugin_version_6/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 30th November 2016 , last changed 17th September 2020

  
[GMImage.SetDepth](GMImageSetDepth.md) - [GMImage.SetEndian](GMImageSetEndian.md)

[HTML Version](GMImageSetEXIFOrientation.shtml)