haraldk / TwelveMonkeys

TwelveMonkeys ImageIO: Additional plug-ins and extensions for Java's ImageIO
https://haraldk.github.io/TwelveMonkeys/
BSD 3-Clause "New" or "Revised" License
1.88k stars 312 forks source link

PSD: Get layer kind (type) to metadata #893

Open zzq0324 opened 8 months ago

zzq0324 commented 8 months ago

Is your feature request related to a use case or a problem you are working on? Please describe. I want to get layer kind. Now I use this code to get header and layer info:

IIOMetadata metadata = imageReader.getImageMetadata(0);
IIOMetadataNode root = (IIOMetadataNode) metadata.getAsTree("com_twelvemonkeys_imageio_psd_image_1.0");
NodeList header = root.getElementsByTagName("Header");
NodeList layers = root.getElementsByTagName("Layers");

But I can't find how to get kind of layer, if it is image or text.

Describe the solution you'd like In layerInfo, can add kind field indicate whether it is a image or text.

Additional context In python librady psd-tools, it support. image

Thank you very much to share this good project.

haraldk commented 8 months ago

Hi @zzq0324 ,

I will accept a PR for this feature, if you want to do it!

Otherwise, it will help if you can figure out how to obtain the layer type, preferably with a reference to the applicable field(s) in the PSD layer format. It can probably be worked out, but it's not entirely clear to me where to get this information.