Interface Metadata

All Known Implementing Classes:
EmptyMetadata, ImageIOMetadata, MutableMetadata

public interface Metadata

Physical embedded image metadata.

For image files with multiple embedded subimages, an instance applies only to a single subimage, i.e. each subimage will have its own instance.

See Also:
  • Method Details

    • getEXIF

      Optional<Directory> getEXIF()
      Returns:
      EXIF data.
    • getIPTC

      List<DataSet> getIPTC()
      Returns:
      List of IPTC IIM data sets.
    • getNativeMetadata

      Optional<NativeMetadata> getNativeMetadata()
      Returns:
      Format-native metadata.
    • getOrientation

      Orientation getOrientation()

      Reads the orientation from the Orientation tag in EXIF data, falling back to the XMP orientation triple in XMP data.

      Returns:
      Image orientation, or Orientation.ROTATE_0 if orientation is not specified in EXIF or XMP data.
    • getXMP

      Optional<String> getXMP()
      Returns:
      RDF/XML string in UTF-8 encoding. The root element is rdf:RDF, and there is no packet wrapper.
      See Also:
    • getXMPElements

      Map<String,Object> getXMPElements()
      Returns:
      Map of elements found in the XMP data. If none are found, the map is empty.
    • getXMPModel

      Optional<org.apache.jena.rdf.model.Model> getXMPModel()
      Returns:
      XMP model backed by the contents of getXMP().
    • toMap

      default Map<String,Object> toMap()

      Returns a map with the following structure:

      
       {
           "exif": See {@link Directory#toMap()},
           "iptc": See {@link DataSet#toMap()},
           "xmp_string": "&lt;rdf:RDF&gt;...&lt;/rdf:RDF&gt;",
           "xmp_model": [Jena model],
           "xmp_elements": {@link Map}
           "native": {@link Map}
       }

      This default implementation will return such a map, but subclasses that use the native key should override and set its value to a Map rather than a string.

      Returns:
      Map representation of the instance.