com.groupdocs.metadata.core

Interfaces

Classes

Exceptions

com.groupdocs.metadata.core

Class PsdRootPackage

  • All Implemented Interfaces:
    IExif, IIptc, IXmp, Iterable<MetadataProperty>


    public class PsdRootPackage
    extends ImageRootPackage
    implements IXmp, IIptc, IExif

    Represents the root package allowing working with metadata in a Photoshop Document.

    This code sample demonstrates how to read the header of a PSD file and extract some information about the PSD layers.

    try (Metadata metadata = new Metadata(Constants.PsdWithIptc)) {
         PsdRootPackage root = metadata.getRootPackageGeneric();
         System.out.println(root.getPsdPackage().getChannelCount());
         System.out.println(root.getPsdPackage().getColorMode());
         System.out.println(root.getPsdPackage().getCompression());
         System.out.println(root.getPsdPackage().getPhotoshopVersion());
         for (PsdLayer layer : root.getPsdPackage().getLayers()) {
             System.out.println(layer.getName());
             System.out.println(layer.getBitsPerPixel());
             System.out.println(layer.getChannelCount());
             System.out.println(layer.getFlags());
             System.out.println(layer.getHeight());
             System.out.println(layer.getWidth());
             // ...
         }
         // ...
     }
     
    • Method Detail

      • getXmpPackage

        public final XmpPacketWrapper getXmpPackage()

        Gets the XMP metadata package.

        Specified by:
        getXmpPackage in interface IXmp
        Returns:
        The XMP metadata package.
      • setXmpPackage

        public final void setXmpPackage(XmpPacketWrapper value)

        Sets the XMP metadata package.

        Specified by:
        setXmpPackage in interface IXmp
        Parameters:
        value - The XMP metadata package.
      • getExifPackage

        public final ExifPackage getExifPackage()

        Gets the EXIF metadata package.

        Specified by:
        getExifPackage in interface IExif
        Returns:
        The EXIF metadata package.
      • setExifPackage

        public final void setExifPackage(ExifPackage value)

        Sets the EXIF metadata package.

        Specified by:
        setExifPackage in interface IExif
        Parameters:
        value - The EXIF metadata package.
      • getIptcPackage

        public final IptcRecordSet getIptcPackage()

        Gets the IPTC metadata package.

        Specified by:
        getIptcPackage in interface IIptc
        Returns:
        The IPTC metadata package.
      • setIptcPackage

        public final void setIptcPackage(IptcRecordSet value)

        Sets the IPTC metadata package.

        Specified by:
        setIptcPackage in interface IIptc
        Parameters:
        value - The IPTC metadata package.
      • getImageResourcePackage

        public final ImageResourcePackage getImageResourcePackage()

        Gets the Photoshop Image Resource metadata package. Image resource blocks are the basic building unit of Photoshop native file format.

        Returns:
        The Image Resource metadata package.
      • getPsdPackage

        public final PsdPackage getPsdPackage()

        Gets the metadata package containing information about the PSD file.

        Returns:
        The metadata package containing information about the PSD file.