GMImage.GetOrientation
----------------------

Queries the image orientation.

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

MBS( "GMImage.GetOrientation"; ImageRef ) 

**MBS**( **"GMImage.GetOrientation";** /\* Queries the image orientation. \*/  
**$ImageRef**) /\* The image reference number.e.g. 1 \*/ 

### Parameters

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

### Result

Returns a number.

### Description

Queries the image orientation.  
Possible orientation values:  
  
| 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 |

### Examples

Set and query orientation:

 Set Variable \[ $Image ; Value: MBS ("[GMImage.New](GMImageNew.md)"; "200x200"; "white") \]   
Set Variable \[ $r ; Value: MBS ("[GMImage.SetOrientation](GMImageSetOrientation.md)"; $Image ; 5) \]   
Show Custom Dialog \[ "LineWidth" ; MBS ("GMImage.GetOrientation";$Image ;) \]   
Set Variable \[ $r ; Value: MBS ("[GMImage.Release](GMImageRelease.md)";$Image ) \]  
### See also

- [GMImage.GetEXIFOrientation](GMImageGetEXIFOrientation.md)
- [GMImage.New](GMImageNew.md)
- [GMImage.Release](GMImageRelease.md)
- [GMImage.SetEXIFOrientation](GMImageSetEXIFOrientation.md)
- [GMImage.SetOrientation](GMImageSetOrientation.md)

### Example Databases

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

### Blog Entries

- [Correct Image Orientation in FileMaker](https://www.mbsplugins.de/archive/2018-11-09/Correct_Image_Orientation_in_F/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 18th August 2014 , last changed 17th September 2020

  
[GMImage.GetMonochrome](GMImageGetMonochrome.md) - [GMImage.GetPNGAsBase64](GMImageGetPNGAsBase64.md)

[HTML Version](GMImageGetOrientation.shtml)