Platforms to show: All Mac Windows Linux Cross-Platform

Back to CGMutableImageMetadataMBS class.

CGMutableImageMetadataMBS.Constructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreGraphics MBS MacCG Plugin 18.5 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates an empty metadata object.

See also:

CGMutableImageMetadataMBS.Constructor(metadata as CGImageMetadataMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreGraphics MBS MacCG Plugin 18.5 ✅ Yes ❌ No ❌ No ✅ Yes All
Copy constructor.

Creates a copy of the metadata.

See also:

CGMutableImageMetadataMBS.RegisterNamespaceForPrefix(parent as CGImageMetadataTagMBS = nil, xmlns as String, prefix as String, byref error as CFErrorMBS) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreGraphics MBS MacCG Plugin 18.5 ✅ Yes ❌ No ❌ No ✅ Yes All
Associates an XMP namespace URI with a prefix string.

This allows ImageIO to create custom metadata when it encounters an unrecognized prefix in a path (see TagWithPath for more information about path syntax). A namespace must be registered before it can be used to add custom metadata. All namespaces found in the image's metadata, or defined as a constant above, will be pre-registered. Namespaces and prefixes must be unique.

Returns true if successful. Returns false and sets 'error' if an error or conflict occurs.

CGMutableImageMetadataMBS.RemoveTagWithPath(parent as CGImageMetadataTagMBS = nil, path as string) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreGraphics MBS MacCG Plugin 18.5 ✅ Yes ❌ No ❌ No ✅ Yes All
Sets the tag at a specific path in a CGMutableImageMetadataMBS container or a parent tag

This is the primary function for adding new metadata tags to a metadata container, or updating existing tags. All tags required to reach the final tag (at the end of the path) will be created, if needed. Tags will created with default types (ordered arrays). Creating tags will fail if a prefix is encountered that has not been registered. Use RegisterNamespaceForPrefix to associate a prefix with a namespace prior to using a path-based CGImageMetadataMBS function.

Note that if a parent tag is provided, the children of that tag reference will be modified, which may be a different reference from the tag stored in the metadata container. Since tags are normally obtained as a copy, it is typically neccesary to use SetTagWithPath to commit the changed parent object back to the metadata container (using the parent's path and nil for the parent).

metadata: A mutable collection of metadata tags.
parent: A parent tag. If nil, the path is relative to the root of the metadata (i.e. it is not a child of another property).
Note that if a parent tag is provided, the children of that tag reference will be modified, which may be a different reference from the tag stored in the metadata container. Since tags are normally obtained as a copy, it is typically neccesary to use SetTagWithPath to commit the changed parent object back to the metadata container (using the parent's path and nil for the parent).
path: A string with the path to the desired tag. Please consult the documentation of TagWithPath for information about path syntax.
Value: The CGImageMetadataTagMBS object to be added to the metadata. The tag will be retained.

Returns true if successful, false otherwise.

CGMutableImageMetadataMBS.SetTagWithPath(parent as CGImageMetadataTagMBS = nil, path as string, value as CGImageMetadataTagMBS) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreGraphics MBS MacCG Plugin 18.5 ✅ Yes ❌ No ❌ No ✅ Yes All
Sets the value of the tag at a specific path in a CGMutableImageMetadataMBS container or a parent tag.

This function is used to add new metadata values to a metadata container, or update existing tag values. All tags required to reach the final tag (at the end of the path) are created, if needed. Tags are created with default types (i.e. arrays will be ordered). Creating tags will fail if a prefix is encountered that has not been registered. Use RegisterNamespaceForPrefix to associate a prefix with a namespace prior to using a path-based CGImageMetadata function.

Examples

  • 'path' = "xmp:CreateDate", 'value' = "2011-09-20T14:54:47-08:00")
  • 'path' = "dc:subject[0]", 'value' = "San Francisco")
  • 'path' = "dc:subject[1]", 'value' = "Golden Gate Bridge")
  • 'path' = "dc:description[en]" 'value' = "my image description")
  • 'path' = "dc:description[de]" 'value' = "meine bildbeschreibung")

Note that if a parent tag is provided, the children of that tag reference will be modified, which may be a different reference from the tag stored in the metadata container. Since tags are normally obtained as a copy, it is typically neccesary to use SetTagWithPath to commit the changed parent object back to the metadata container (using the parent's path and "" for the parent).

parent: A parent tag. If nil, the path is relative to the root of the metadata (i.e. it is not a child of another property).
path: A string with the path to the desired tag. Please consult the documentation of TagWithPath for information about path syntax.
value: The value to be added to the CGImageMetadataTag matching the path.

The tag will be retained. The restrictions for the value are the same as in Create.
Returns true if successful, false otherwise.

CGMutableImageMetadataMBS.SetValueMatchingImageProperty(dictionaryName as String, propertyName as String, value as CGImageMetadataTagMBS) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreGraphics MBS MacCG Plugin 18.5 ✅ Yes ❌ No ❌ No ✅ Yes All
Sets the value of the CGImageMetadataTag matching a kCGImageProperty constant.

Provides a bridge for values from CGImageCopyPropertiesAtIndex, simplifying changing property values defined in EXIF and IPTC standards, which have no notion of namespaces, prefixes, or XMP property types.
Metadata Working Group guidance is factored into the mapping of CGImageProperties to XMP compatible CGImageMetadataTags.

For example, setting kCGImagePropertyExifDateTimeOriginal will set the value of the corresponding XMP tag, which is photoshop:DateCreated. Note that property values should still be in their XMP forms, such as "YYYY-MM-DDThh:mm:ss" for DateTime, rather than the EXIF or IPTC DateTime formats. Although this function will allow the caller to set custom values for these properties, you should consult the appropriate specifications for details about property value formats for EXIF and IPTC tags in XMP.

dictionaryName the metadata subdictionary to which the image property belongs, such as kCGImagePropertyExifDictionary or kCGImagePropertyIPTCDictionary. Not all dictionaries and properties are supported at this time.
propertyName the name of the property. This must be a defined property constant corresponding to the 'dictionaryName'. For example, kCGImagePropertyTIFFOrientation, kCGImagePropertyExifDateTimeOriginal, or kCGImagePropertyIPTCKeywords. A warning will be logged if the CGImageProperty is unsupported by CGImageMetadata.
value: A variant with the value for the tag. The same value restrictions apply as in Create.

Returns true if successful, false otherwise.

CGMutableImageMetadataMBS.SetValueWithPath(parent as CGImageMetadataTagMBS = nil, path as string, value as Variant) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreGraphics MBS MacCG Plugin 18.5 ✅ Yes ❌ No ❌ No ✅ Yes All
Sets the value of the tag at a specific path in a CGMutableImageMetadataMBS container or a parent tag.

This function is used to add new metadata values to a metadata container, or update existing tag values. All tags required to reach the final tag (at the end of the path) are created, if needed. Tags are created with default types (i.e. arrays will be ordered). Creating tags will fail if a prefix is encountered that has not been registered. Use RegisterNamespaceForPrefix to associate a prefix with a namespace prior to using a path-based CGImageMetadata function.

Examples

  • 'path' = "xmp:CreateDate", 'value' = "2011-09-20T14:54:47-08:00")
  • 'path' = "dc:subject[0]", 'value' = "San Francisco")
  • 'path' = "dc:subject[1]", 'value' = "Golden Gate Bridge")
  • 'path' = "dc:description[en]" 'value' = "my image description")
  • 'path' = "dc:description[de]" 'value' = "meine bildbeschreibung")

Note that if a parent tag is provided, the children of that tag reference will be modified, which may be a different reference from the tag stored in the metadata container. Since tags are normally obtained as a copy, it is typically neccesary to use SetTagWithPath to commit the changed parent object back to the metadata container (using the parent's path and "" for the parent).

parent: A parent tag. If nil, the path is relative to the root of the metadata (i.e. it is not a child of another property).
path: A string with the path to the desired tag. Please consult the documentation of TagWithPath for information about path syntax.
value: The value to be added to the CGImageMetadataTag matching the path.

The tag will be retained. The restrictions for the value are the same as in Create.
Returns true if successful, false otherwise.

The items on this page are in the following plugins: MBS MacCG Plugin.


The biggest plugin in space...