CGImageSource.HasProperty
-------------------------

Query whether the property exists.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [CGImageSource](component_CGImageSource.md) | [9.4](newinversion94.md) | ✅ Yes | ❌ No | ❌ No | ✅ Yes, on macOS | ✅ Yes |

MBS( "CGImageSource.HasProperty"; Ref; Index; Key ) 

**MBS**( **"CGImageSource.HasProperty";** /\* Query whether the property exists. \*/  
**$Ref**; /\* The image source reference number returned by [CGImageSource.CreateWithData](CGImageSourceCreateWithData.md), [CGImageSource.CreateWithPath](CGImageSourceCreateWithPath.md) or [CGImageSource.CreateWithURL](CGImageSourceCreateWithURL.md) \*/   
**$Index**; /\* The index of the image to query. -1 for global properties. Else a number from 0 to [CGImageSource.Count](CGImageSourceCount.md)-1.e.g. 0 \*/   
**$Key**) /\* The property name to query.e.g. "PixelWidth" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Ref | The image source reference number returned by [CGImageSource.CreateWithData](CGImageSourceCreateWithData.md), [CGImageSource.CreateWithPath](CGImageSourceCreateWithPath.md) or [CGImageSource.CreateWithURL](CGImageSourceCreateWithURL.md) | $ref |
| Index | The index of the image to query. -1 for global properties. Else a number from 0 to [CGImageSource.Count](CGImageSourceCount.md)-1. | 0 |
| Key | The property name to query. | "PixelWidth" |

### Result

Returns 1, 0 or error.

### Description

Query whether the property exists.  
Returns 1 if property is found.  
### See also

- [CGImageSource.ClearProperties](CGImageSourceClearProperties.md)
- [CGImageSource.Count](CGImageSourceCount.md)
- [CGImageSource.CreateWithData](CGImageSourceCreateWithData.md)
- [CGImageSource.CreateWithPath](CGImageSourceCreateWithPath.md)
- [CGImageSource.CreateWithURL](CGImageSourceCreateWithURL.md)
- [CGImageSource.Properties](CGImageSourceProperties.md)
- [CGImageSource.Property](CGImageSourceProperty.md)
- [CGImageSource.SetProperty](CGImageSourceSetProperty.md)

### Release notes

- **Version 9.4**
    - Added [CGImageSource.HasProperty](http://www.mbsplugins.eu/CGImageSourceHasProperty.shtml) and [CGImageSource.SetProperty](http://www.mbsplugins.eu/CGImageSourceSetProperty.shtml) to set metadata (IPTC/EXIF) and write file back.

### Blog Entries

- [Neue Funktionen des MBS FileMaker Plugin 9.4](https://www.mbsplugins.de/archive/2019-10-05/Neue_Funktionen_des_MBS_FileMa/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 9.4pr5](https://www.mbsplugins.de/archive/2019-09-05/MBS_FileMaker_Plugin_version_9/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 30th August 2019 , last changed 28th November 2019

  
[CGImageSource.FileName](CGImageSourceFileName.md) - [CGImageSource.ImageAtIndex](CGImageSourceImageAtIndex.md)

[HTML Version](CGImageSourceHasProperty.shtml)