CGImageSource.Properties
------------------------

Queries all properties as JSON.

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

MBS( "CGImageSource.Properties"; Ref { ; Index } ) 

**MBS**( **"CGImageSource.Properties";** /\* Queries all properties as JSON. \*/  
**$Ref**; /\* The image source reference number returned by [CGImageSource.CreateWithData](CGImageSourceCreateWithData.md), [CGImageSource.CreateWithPath](CGImageSourceCreateWithPath.md) or [CGImageSource.CreateWithURL](CGImageSourceCreateWithURL.md) \*/   
**$Index**) /\* Optional; 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 \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| 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 | Optional |

### Result

Returns JSON or error.

### Description

Queries all properties as JSON.  
### Examples

Query properties for first image:

 MBS ("CGImageSource.Properties"; $ref ; 0)  
<small>  
Example result:   
{ "{TIFF}" : { "ResolutionUnit" : 2 , "Software" : "QuickTime 7.5.5" , "DateTime" : "2008:10:19 13:29:12" , "XResolution" : 72 , "ImageDescription" : "Digital StillCamera" , "Orientation" : 1 , "YResolution" : 72 , "Model" : "DC-8300" , "Make" : "Traveler" }, "{IPTC}" : { "DigitalCreationTime" : "142931" , "DigitalCreationDate" : "20081015" , "TimeCreated" : "142931" , "DateCreated" : "20081015" , "Caption\\/Abstract" : "Digital StillCamera" }, "{Exif}" : { "DateTimeOriginal" : "2008:10:15 14:29:31" , "ComponentsConfiguration" : \[ 1 , 2 , 3 , 0 \], "MaxApertureValue" : 3.1 , "DigitalZoomRatio" : 1 , "ExposureBiasValue" : 0 , "Saturation" : 0 , "FNumber" : 4.8 , "SceneCaptureType" : 0 , "ShutterSpeedValue" : 6.67 , "SubjectDistRange" : 0 , "ApertureValue" : 4.5 , "FileSource" : 3 , "Sharpness" : 0 , "ColorSpace" : 1 , "Contrast" : 0 , "PixelYDimension" : 267 , "WhiteBalance" : 0 , "LightSource" : 0 , "FlashPixVersion" : \[ 1 , 0 \], "DateTimeDigitized" : "2008:10:15 14:29:31" , "ISOSpeedRatings" : \[ 50 \], "ExposureMode" : 0 , "PixelXDimension" : 200 , "ExifVersion" : \[ 2 , 2 \], "CustomRendered" : 0 , "ExposureProgram" : 2 , "Flash" : 0 , "ExposureTime" : 0.01 , "FocalLenIn35mmFilm" : 68 , "MeteringMode" : 2 }, "PixelHeight" : 267 , "PixelWidth" : 200 , "{JFIF}" : { "XDensity" : 72 , "YDensity" : 72 , "IsProgressive" : true, "JFIFVersion" : \[ 1 , 0 , 1 \], "DensityUnit" : 1 }, "ProfileName" : "sRGB IEC61966-2.1" , "DPIWidth" : 72 , "DPIHeight" : 72 , "ColorModel" : "RGB" , "Orientation" : 1 , "Depth" : 8 } </small>Read in metadata for image:

 Set Variable \[ $path ; Value: "/Users/cs/Desktop/IMG\_3552.HEIC" \]   
Set Variable \[ $ImageSource ; Value: MBS ( "[CGImageSource.CreateWithPath](CGImageSourceCreateWithPath.md)"; $path ) \]   
If \[ MBS ("IsError") = 0 \]   
 # you can get metadata as JSON to check later...  
 Set Variable \[ $$MetaData ; Value: MBS ( "CGImageSource.Properties"; $ImageSource ) \]   
 Set Variable \[ $$ImageMetaData ; Value: MBS ( "CGImageSource.Properties"; $ImageSource ; 0 ) \]   
 Set Variable \[ $r ; Value: MBS ( "[CGImageSource.Release](CGImageSourceRelease.md)"; $ImageSource ) \]   
End If  
### See also

- [CGImageSource.ClearProperties](CGImageSourceClearProperties.md)
- [CGImageSource.Count](CGImageSourceCount.md)
- [CGImageSource.CreateWithData](CGImageSourceCreateWithData.md)
- [CGImageSource.CreateWithPath](CGImageSourceCreateWithPath.md)
- [CGImageSource.CreateWithURL](CGImageSourceCreateWithURL.md)
- [CGImageSource.HasProperty](CGImageSourceHasProperty.md)
- [CGImageSource.ImageAtIndex](CGImageSourceImageAtIndex.md)
- [CGImageSource.Property](CGImageSourceProperty.md)
- [CGImageSource.SetProperty](CGImageSourceSetProperty.md)
- [IsError](IsError.md)

### Release notes

- **Version 8.3**
    - Added [CGImageSource.Properties](http://www.mbsplugins.eu/CGImageSourceProperties.shtml) function.

### Example Databases

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

### Blog Entries

- [Read HEIC or HEIF image files in FileMaker](https://www.mbsplugins.de/archive/2019-08-20/Read_HEIC_or_HEIF_image_files_/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 8.3pr2](https://www.mbsplugins.de/archive/2018-06-18/MBS_FileMaker_Plugin_version_8/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 6th June 2018 , last changed 19th October 2023

  
[CGImageSource.List](CGImageSourceList.md) - [CGImageSource.Property](CGImageSourceProperty.md)

[HTML Version](CGImageSourceProperties.shtml)