GMImage.SetAttribute
--------------------

Set a named attribute.

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

MBS( "GMImage.SetAttribute"; ImageRef; Name; Value { ; Encoding } ) 

**MBS**( **"GMImage.SetAttribute";** /\* Set a named attribute. \*/  
**$ImageRef**; /\* The image reference number.e.g. 1 \*/   
**$Name**; /\* The name of the attribute. \*/   
**$Value**; /\* The value of the attribute. \*/   
**$Encoding**) /\* Optional; The text encoding.  
Default is UTF-8.e.g. UTF8 \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| ImageRef | The image reference number. | 1 |  |
| Name | The name of the attribute. |  |  |
| Value | The value 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](https://www.monkeybreadsoftware.com/filemaker/faq.shtml). | UTF8 | Optional |

### Result

Returns "OK" on success.

### Description

Set a named attribute.  
GraphicsMagick does not support writing attributes back to files, so this only stores new value in memory for [GMImage.GetAttribute](GMImageGetAttribute.md) to query.  
### See also

- [GMImage.GetAttribute](GMImageGetAttribute.md)

### Blog Entries

- [MBS FileMaker Plugin, version 6.5pr8](https://www.mbsplugins.de/archive/2016-11-22/MBS_FileMaker_Plugin_version_6/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin Decision Graphs](https://www.mbsplugins.de/archive/2016-11-22/MBS_FileMaker_Plugin_Decision_/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 18th August 2014 , last changed 18th April 2019

  
[GMImage.SetAntiAlias](GMImageSetAntiAlias.md) - [GMImage.SetBackgroundColor](GMImageSetBackgroundColor.md)

[HTML Version](GMImageSetAttribute.shtml)