Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
GMImage.AutoOrient
Orient image to be right-side up based on its current orientation attribute.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
GraphicsMagick | 9.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
MBS( "GMImage.AutoOrient"; ImageRef ) More
Parameters
Parameter | Description | Example |
---|---|---|
ImageRef | The image reference number. | 1 |
Result
Returns OK or error.
Description
Orient image to be right-side up based on its current orientation attribute.This allows the image to be viewed correctly when the orientation attribute is not available, or is not respected.
Examples
Try it:
# load image
Set Variable [ $Image ; Value: MBS( "GMImage.NewFromContainer"; Correct Image Orientation::Input ) ]
If [ MBS("IsError") = 0 ]
#
Set Variable [ $r ; Value: MBS( "GMImage.AutoOrient"; $Image ) ]
#
# Write back to new field
Set Field [ Correct Image Orientation::Output ; MBS( "GMImage.WriteToJPEGContainer"; $Image; GetAsText(Correct Image Orientation::Input)) ]
#
# free memory
Set Variable [ $r ; Value: MBS( "GMImage.Free"; $Image) ]
End If
See also
- GMImage.Free
- GMImage.New
- GMImage.NewFromContainer
- GMImage.SetOrientation
- GMImage.WriteToJPEGContainer
- IsError
Release notes
- Version 9.0
- Added GMImage.AutoOrient, GMImage.Extent, GMImage.GetQuiet, GMImage.Repage, GMImage.Resize and GMImage.SetQuiet functions.
Blog Entries
This function checks for a license.
Created 28th December 2018, last changed 21st February 2023
