CGImageMetadataCopyTagMatchingImageProperty(_:_:_:)
Searches for the specified image property and, if found, returns the corresponding tag object.
Declaration
func CGImageMetadataCopyTagMatchingImageProperty(_ metadata: CGImageMetadata, _ dictionaryName: CFString, _ propertyName: CFString) -> CGImageMetadataTag?Parameters
- metadata:
The metadata object to search.
- dictionaryName:
The metadata subdictionary to which the image property belongs. For example, specify Kcgimagepropertyexifdictionary for image properties that are part of the image’s EXIF metadata.
- propertyName:
The name of the property. For example, specify Kcgimagepropertytifforientation, Kcgimagepropertyexifdatetimeoriginal, or Kcgimagepropertyiptckeywords. If the specified property is unsupported by the metadata object, this function logs a warning.
Return Value
The CGImageMetadataTag object that corresponds to the specified property, or NULL if the property wasn’t found.
Discussion
Use this function to quickly search the different metadata dictionaries for a specific tag. The returned tag object contains appropriate values for all fields, including the namespace, prefix, and XMP type.
When you request an EXIF or IPTC property, this function fills in the namespace, prefix, and XMP type information by copying information from an appropriate XMP type. For example, when you request the kCGImagePropertyExifDateTimeOriginal property, the function fills in the information using the photoshop:DateTime XMP tag. When this bridging occurs, property fields retain their XMP format, rather than the EXIF or IPTC format.