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()); // ... } // ... }
Modifier and Type | Method and Description |
---|---|
ExifPackage |
getExifPackage()
Gets the EXIF metadata package.
|
ImageResourcePackage |
getImageResourcePackage()
Gets the Photoshop Image Resource metadata package.
|
IptcRecordSet |
getIptcPackage()
Gets the IPTC metadata package.
|
PsdPackage |
getPsdPackage()
Gets the metadata package containing information about the PSD file.
|
XmpPacketWrapper |
getXmpPackage()
Gets the XMP metadata package.
|
void |
setExifPackage(ExifPackage value)
Sets the EXIF metadata package.
|
void |
setIptcPackage(IptcRecordSet value)
Sets the IPTC metadata package.
|
void |
setXmpPackage(XmpPacketWrapper value)
Sets the XMP metadata package.
|
getImageType
getFileType, sanitize
addProperties, contains, findProperties, get_Item, getCount, getKeys, getKnowPropertyDescriptors, getMetadataType, getPropertyDescriptors, iterator, removeProperties, setProperties, updateProperties
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public final XmpPacketWrapper getXmpPackage()
Gets the XMP metadata package.
getXmpPackage
in interface IXmp
Learn more
public final void setXmpPackage(XmpPacketWrapper value)
Sets the XMP metadata package.
setXmpPackage
in interface IXmp
value
- The XMP metadata package.
Learn more
public final ExifPackage getExifPackage()
Gets the EXIF metadata package.
getExifPackage
in interface IExif
Learn more
public final void setExifPackage(ExifPackage value)
Sets the EXIF metadata package.
setExifPackage
in interface IExif
value
- The EXIF metadata package.
Learn more
public final IptcRecordSet getIptcPackage()
Gets the IPTC metadata package.
getIptcPackage
in interface IIptc
Learn more
public final void setIptcPackage(IptcRecordSet value)
Sets the IPTC metadata package.
setIptcPackage
in interface IIptc
value
- The IPTC metadata package.
Learn more
public final ImageResourcePackage getImageResourcePackage()
Gets the Photoshop Image Resource metadata package. Image resource blocks are the basic building unit of Photoshop native file format.
public final PsdPackage getPsdPackage()
Gets the metadata package containing information about the PSD file.