GMImage.GetComment
------------------

Queries the comment.

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

MBS( "GMImage.GetComment"; ImageRef ) 

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

### Parameters

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

### Result

Returns the comment.

### Description

Queries the comment.  
### Examples

Query comment:

 Set Variable \[ $image ; Value: MBS ( "[GMImage.NewFromFile](GMImageNewFromFile.md)"; "/Users/cs/Pictures/IMG\_6917.jpeg" ) \]   
If \[ MBS ("IsError") \]   
 Show Custom Dialog \[ "Failed to load image." ; $image \]   
Else  
 Set Variable \[ $comment ; Value: MBS ( "GMImage.GetComment"; $image ) \]   
 Set Variable \[ $UserComment ; Value: MBS ("[GMImage.GetAttribute](GMImageGetAttribute.md)"; $image ; "EXIF:UserComment") \]   
 Set Variable \[ $ByLine ; Value: MBS ( "[GMImage.GetAttribute](GMImageGetAttribute.md)"; $image ; "IPTC:2:85" ) \]   
 Show Custom Dialog \[ "Results" ; $comment &amp; ¶ &amp; $UserComment &amp; ¶ &amp; $ByLine \]   
 #   
 Set Variable \[ $r ; Value: MBS ( "[GMImage.Release](GMImageRelease.md)"; $image ) \]   
End If  
### See also

- [GMImage.GetAttribute](GMImageGetAttribute.md)
- [GMImage.GetCompose](GMImageGetCompose.md)
- [GMImage.GetFont](GMImageGetFont.md)
- [GMImage.New](GMImageNew.md)
- [GMImage.NewFromFile](GMImageNewFromFile.md)
- [GMImage.Release](GMImageRelease.md)
- [GMImage.SetComment](GMImageSetComment.md)
- [GMImage.SetCompose](GMImageSetCompose.md)
- [IsError](IsError.md)

This function checks for a license.

Created 18th August 2014 , last changed 2nd October 2023

  
[GMImage.GetColorSpace](GMImageGetColorSpace.md) - [GMImage.GetCompose](GMImageGetCompose.md)

[HTML Version](GMImageGetComment.shtml)