GMImage.GetAttributesJSON
-------------------------

Queries all attributes as JSON.

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

MBS( "GMImage.GetAttributesJSON"; ImageRef ) 

**MBS**( **"GMImage.GetAttributesJSON";** /\* Queries all attributes as JSON. \*/  
**$ImageRef**) /\* The image reference number.e.g. 1 \*/ 

### Parameters

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

### Result

Returns JSON object or error.

### Description

Queries all attributes as JSON.  
Only attributes created before are visible, so e.g. EXIF data may not yet be loaded and parsed.  
e.g. for a PNG this may include the original color type and the bit depth:  
{  
| "png:IHDR.color-type-orig": | "4", |
|---|---|
| "png:IHDR.bit-depth-orig": | "16" |

}  
  
For macOS and iOS, also see [CGImageSource](component_CGImageSource.md) functions to read metadata like EXIF and IPTC. And also check [MetaDataQuery.AttributesForFile](MetaDataQueryAttributesForFile.md) function to get generic metadata.  
### Examples

Show attributes:

 Set Variable \[ $ImageRef ; Value: MBS ("[GMImage.NewFromFile](GMImageNewFromFile.md)"; "/Users/cs/Desktop/image2.png") \]   
Show Custom Dialog \[ "Attributes" ; MBS ( "GMImage.GetAttributesJSON"; $ImageRef ) \]   
Set Variable \[ $r ; Value: MBS ("[GMImage.Release](GMImageRelease.md)"; $ImageRef ) \]  
### See also

- [GMImage.GetAttribute](GMImageGetAttribute.md)
- [GMImage.GetAttributeNames](GMImageGetAttributeNames.md)
- [GMImage.New](GMImageNew.md)
- [GMImage.NewFromFile](GMImageNewFromFile.md)
- [GMImage.Release](GMImageRelease.md)
- [MetaDataQuery.AttributesForFile](MetaDataQueryAttributesForFile.md)

### Release notes

- **Version 15.3**
    - Improved [GMImage.GetAttribute](https://www.mbsplugins.eu/GMImageGetAttribute.shtml) and [GMImage.GetAttributesJSON](https://www.mbsplugins.eu/GMImageGetAttributesJSON.shtml) to decode high characters in text values.
- **Version 9.2**
    - Added [GMImage.GetAttributeNames](http://www.mbsplugins.eu/GMImageGetAttributeNames.shtml) and [GMImage.GetAttributesJSON](http://www.mbsplugins.eu/GMImageGetAttributesJSON.shtml) functions.

### Blog Entries

- [MBS FileMaker Plugin, version 15.3pr1](https://www.mbsplugins.de/archive/2025-06-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [GraphicsMagick in FileMaker, part 19](https://www.mbsplugins.de/archive/2022-12-19/GraphicsMagick_in_FileMaker_pa/monkeybreadsoftware_blog_filemaker)
- [Was gibt es neues bei MBS Version 9.2](https://www.mbsplugins.de/archive/2019-07-16/Was_gibt_es_neues_bei_MBS_Vers/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 9.2pr4](https://www.mbsplugins.de/archive/2019-04-25/MBS_FileMaker_Plugin_version_9/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 18th April 2019 , last changed 20th May 2025

  
[GMImage.GetAttributeNames](GMImageGetAttributeNames.md) - [GMImage.GetBackgroundColor](GMImageGetBackgroundColor.md)

[HTML Version](GMImageGetAttributesJSON.shtml)