| Components | All | New | MacOS | Windows | Linux | iOS | ||||
| Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old | |
CGImageSource.Properties
Queries all properties as JSON.
| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
| CGImageSource | 8.3 | ✅ Yes | ❌ No | ❌ No | ✅ Yes, on macOS | ✅ Yes |
MBS( "CGImageSource.Properties"; Ref { ; Index } ) More
Parameters
| Parameter | Description | Example | Flags |
|---|---|---|---|
| Ref | The image source reference number returned by CGImageSource.CreateWithData, CGImageSource.CreateWithPath or CGImageSource.CreateWithURL | $ref | |
| Index | The index of the image to query. -1 for global properties. Else a number from 0 to CGImageSource.Count-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)
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 }
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 }
Read in metadata for image:
Set Variable [ $path ; Value: "/Users/cs/Desktop/IMG_3552.HEIC" ]
Set Variable [ $ImageSource ; Value: MBS( "CGImageSource.CreateWithPath"; $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"; $ImageSource ) ]
End If
Set Variable [ $ImageSource ; Value: MBS( "CGImageSource.CreateWithPath"; $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"; $ImageSource ) ]
End If
See also
- CGImageSource.ClearProperties
- CGImageSource.Count
- CGImageSource.CreateWithData
- CGImageSource.CreateWithPath
- CGImageSource.CreateWithURL
- CGImageSource.HasProperty
- CGImageSource.ImageAtIndex
- CGImageSource.Property
- CGImageSource.SetProperty
- IsError
Release notes
- Version 8.3
- Added CGImageSource.Properties function.
Example Databases
Blog Entries
This function checks for a license.
Created 6th June 2018, last changed 19th October 2023