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

Release notes

Blog Entries

This function checks for a license.

Created 28th December 2018, last changed 21st February 2023


GMImage.Annotate - GMImage.AveragePixelValue

💬 Ask a question or report a problem