try_get_comment


Description:

[ Version ( since = "0.14.0" ) ]
public string? try_get_comment () throws Error

A composite accessor that uses the first available metadata field from a list of well-known locations to find the photo's comment (or description).

MWG guidelines refer to these as <emphasis>Description</emphasis>: a textual description of a resource's content.

These fields are:

  • Exif.Image.ImageDescription (MWG Guidelines)
  • Exif.Photo.UserComment
  • Exif.Image.XPComment
  • Iptc.Application2.Caption (MWG Guidelines)
  • Xmp.dc.description (MWG Guidelines)
  • Xmp.acdsee.notes (Commonly requested, read only)

<note>Note that in the EXIF specification Exif.Image.ImageDescription is described as "the title of the image". Also, it does not support two-byte character codes for encoding. However, it's still used here for legacy reasons. </note>

For fine-grained control, it's recommended to use Exiv2 tags directly rather than this method, which is more useful for quick or casual use.

Parameters:

this

An instance of Metadata

Returns:

The photo's comment field.