Topics   All   MacOS (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Deprecated   Guides   Examples   Videos
New in version: 12.2   12.3   12.4   12.5   13.0   13.1   13.2   13.3   13.4   13.5    Statistic    FMM    Blog  

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