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
Query a named attribute.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
GraphicsMagick | 2.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameter | Description | Example | Flags |
---|---|---|---|
ImageRef | The image reference number. | 1 | |
name | The name of the attribute. | ||
Encoding | The text encoding. Default is UTF-8. Possible encoding names: ANSI, ISO-8859-1, Latin1, Mac, Native, UTF-8, DOS, Hex, Base64 or Windows. More listed in the FAQ. |
UTF8 | Optional |
Returns the value as string.
Read EXIF DateTime:
MBS( "GMImage.GetAttribute"; $image; "EXIF:DateTime" )
Query IPTC Keywords:
MBS("GMImage.GetAttribute"; $img; "IPTC:2:25"; "UTF-8")
Query JPEG Quality used to compress image:
Set Variable [$img; Value:MBS("GMImage.NewFromContainer"; Image::InputImage)]
Set Variable [$value; Value:MBS("GMImage.GetAttribute"; $img; "JPEG-Quality")]
Show Custom Dialog ["JPEG Quality used to compress image"; $value]
Set Variable [$r; Value:MBS("GMImage.Release"; $img)]
Read PNG original color type:
MBS("GMimage.GetAttribute"; $image; "png:IHDR.color-type-orig")
// Value is combination of 0 = gray, 1 = palette, 2 = color, 4 = alpha
// e.g. 4 = Gray + Alpha, 6 = RGBA, 2 = RGB, 0 = Gray
Query JPEG Colorspace:
MBS("GMImage.GetAttribute"; $img; "JPEG-Colorspace-Name") & " " & MBS("GMImage.GetAttribute"; $img; "JPEG-Colorspace")
// the numbers are: 1 = grayscale, 2 = RGB, 3 = YCbCr, 4 = CMYK, 5 = YCCK
Show GPS location:
Set Variable [ $img ; Value: MBS("GMImage.NewFromContainer"; GraphicsMagick Exif::InputImage) ]
Set Variable [ $lat ; Value: MBS("GMImage.GetAttribute"; $img; "EXIF:GPSLatitude") ]
Set Variable [ $long ; Value: MBS("GMImage.GetAttribute"; $img; "EXIF:GPSLongitude") ]
Show Custom Dialog [ "GPS" ; $lat & " / " & $long ]
Set Variable [ $r ; Value: MBS("GMImage.Release"; $img) ]
This function checks for a license.
Created 18th August 2014, last changed 24th February 2021