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.

    Learn more

    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());
             // ...
         }
         // ...
     }