CGImageSource.Property
----------------------

Queries the value of a property.

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

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

**MBS**( **"CGImageSource.Property";** /\* Queries the value of a property. \*/  
**$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 the value or error message.

### Description

Queries the value of a property.  
See [CGImageSource.Keys](CGImageSourceKeys.md) for a list of available properties.  
  
Keys include (list not complete):  
  
FileSize, {Exif}.ExposureTime, {Exif}.SubjectDistRange, {Exif}.MaxApertureValue, {Exif}.Flash, {Exif}.ColorSpace, {Exif}.ExifVersion, {Exif}.FocalLenIn35mmFilm, {Exif}.SceneCaptureType, {Exif}.ShutterSpeedValue, {Exif}.FNumber, {Exif}.LightSource, {Exif}.FileSource, {Exif}.Saturation, {Exif}.PixelYDimension, {Exif}.Sharpness, {Exif}.ApertureValue, {Exif}.Contrast, {Exif}.PixelXDimension, {Exif}.CustomRendered, {Exif}.WhiteBalance, {Exif}.DateTimeDigitized, {Exif}.ExposureProgram, {Exif}.ISOSpeedRatings, {Exif}.DateTimeOriginal, {Exif}.MeteringMode, {Exif}.FlashPixVersion, {Exif}.ComponentsConfiguration, {Exif}.ExposureMode, {Exif}.DigitalZoomRatio, {Exif}.ExposureBiasValue, ColorModel, Orientation, DPIHeight, PixelWidth, {IPTC}.Caption/Abstract, {IPTC}.TimeCreated, {IPTC}.DateCreated, {IPTC}.DigitalCreationDate, {IPTC}.DigitalCreationTime, PixelHeight, ProfileName, Depth, {TIFF}.Model, {TIFF}.ResolutionUnit, {TIFF}.YResolution, {TIFF}.XResolution, {TIFF}.Orientation, {TIFF}.ImageDescription, {TIFF}.Software, {TIFF}.DateTime, {TIFF}.Make, {JFIF}.DensityUnit, {JFIF}.IsProgressive, {JFIF}.YDensity, {JFIF}.JFIFVersion, {JFIF}.XDensity, DPIWidth.  
  
Version 10.0 and newer may return arrays and dictionaries as JSON.  
### Examples

Query Image dimensions in pixel :

 MBS ( "CGImageSource.Property"; $ref ; 0; "PixelWidth") &amp; " x " &amp; MBS ( "CGImageSource.Property"; $ref ; 0; "PixelHeight")  
Query Image resolution in dpi:

 MBS ( "CGImageSource.Property"; $ref ; 0; "DPIWidth") &amp; " x " &amp; MBS ( "CGImageSource.Property"; $ref ; 0; "DPIHeight")  
Query GPS of first image:

 Set Variable \[ $img ; Value: MBS ("[CGImageSource.CreateWithData](CGImageSourceCreateWithData.md)"; CGImageSource::ImageFile ) \]   
Set Variable \[ $lat ; Value: MBS ("CGImageSource.Property"; $img ; 0; "{GPS}.Latitude") \]   
Set Variable \[ $long ; Value: MBS ("CGImageSource.Property"; $img ; 0; "{GPS}.Longitude") \]   
Show Custom Dialog \[ "GPS" ; $lat &amp; " / " &amp; $long \]   
Set Variable \[ $r ; Value: MBS ("[CGImageSource.Release](CGImageSourceRelease.md)"; $img ) \]  
### See also

- [CGImageSource.Count](CGImageSourceCount.md)
- [CGImageSource.CreateWithData](CGImageSourceCreateWithData.md)
- [CGImageSource.CreateWithPath](CGImageSourceCreateWithPath.md)
- [CGImageSource.CreateWithURL](CGImageSourceCreateWithURL.md)
- [CGImageSource.Export](CGImageSourceExport.md)
- [CGImageSource.HasProperty](CGImageSourceHasProperty.md)
- [CGImageSource.Keys](CGImageSourceKeys.md)
- [CGImageSource.Properties](CGImageSourceProperties.md)
- [CGImageSource.Release](CGImageSourceRelease.md)
- [CGImageSource.SetProperty](CGImageSourceSetProperty.md)

### Release notes

- **Version 10.0**
    - Changed [CGImageSource.Property](https://www.mbsplugins.eu/CGImageSourceProperty.shtml) to return array or dictionary encoded as JSON.

### Example Databases

- [Mac and iOS/CGImageSource](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Mac%20and%20iOS/CGImageSource.shtml#1ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 10.0pr8](https://www.mbsplugins.de/archive/2020-01-11/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 18th August 2014 , last changed 10th January 2020

  
[CGImageSource.Properties](CGImageSourceProperties.md) - [CGImageSource.Release](CGImageSourceRelease.md)

[HTML Version](CGImageSourceProperty.shtml)