Class MutableMetadata

java.lang.Object
is.galia.image.MutableMetadata
All Implemented Interfaces:
Metadata
Direct Known Subclasses:
ImageIOMetadata

public class MutableMetadata extends Object implements Metadata
Basic mutable implementation.
  • Field Details

  • Constructor Details

    • MutableMetadata

      public MutableMetadata()
  • Method Details

    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • getEXIF

      public Optional<Directory> getEXIF()
      Specified by:
      getEXIF in interface Metadata
      Returns:
      EXIF data.
    • getIPTC

      public List<DataSet> getIPTC()
      Specified by:
      getIPTC in interface Metadata
      Returns:
      List of IPTC IIM data sets.
    • getNativeMetadata

      public Optional<NativeMetadata> getNativeMetadata()
      Specified by:
      getNativeMetadata in interface Metadata
      Returns:
      Format-native metadata, or null if none is present.
    • getOrientation

      public Orientation getOrientation()

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

      Specified by:
      getOrientation in interface Metadata
      Returns:
      Image orientation. Will be Orientation.ROTATE_0 if orientation is not contained in EXIF or XMP data or cannot be read.
    • getXMP

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

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

      public Optional<org.apache.jena.rdf.model.Model> getXMPModel()
      Specified by:
      getXMPModel in interface Metadata
      Returns:
      XMP model backed by the contents of getXMP().
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • setEXIF

      public void setEXIF(Directory exifIFD)
      Parameters:
      exifIFD - EXIF directory (IFD). Not null.
    • setIPTC

      public void setIPTC(List<DataSet> dataSets)
      Parameters:
      dataSets - IPTC IIM data sets. May be null.
    • setNativeMetadata

      public void setNativeMetadata(NativeMetadata nativeMetadata)
      Parameters:
      nativeMetadata - Format-native metadata. May be null.
    • setXMP

      public void setXMP(byte[] xmp)
      Parameters:
      xmp - UTF-8 bytes. May be null.
    • setXMP

      public void setXMP(String xmp)
      Parameters:
      xmp - UTF-8 string. May be null.