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()); // ... } // ... }
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
addProperties, findProperties, getFileType, removeProperties, sanitize, setProperties, updateProperties
contains, get_Item, getCount, getKeys, getKnowPropertyDescriptors, getMetadataType, iterator
public final XmpPacketWrapper getXmpPackage()
Gets the XMP metadata package.
getXmpPackage
in interface IXmp
public final void setXmpPackage(XmpPacketWrapper value)
Sets the XMP metadata package.
setXmpPackage
in interface IXmp
value
- The XMP metadata package.public final ExifPackage getExifPackage()
Gets the EXIF metadata package.
getExifPackage
in interface IExif
public final void setExifPackage(ExifPackage value)
Sets the EXIF metadata package.
setExifPackage
in interface IExif
value
- The EXIF metadata package.public final IptcRecordSet getIptcPackage()
Gets the IPTC metadata package.
getIptcPackage
in interface IIptc
public final void setIptcPackage(IptcRecordSet value)
Sets the IPTC metadata package.
setIptcPackage
in interface IIptc
value
- The IPTC metadata package.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.
Copyright © 2020. All rights reserved.