We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Is there a way to export layer id from Layer model?

Hello.
I’m using your Aspose.PSD solution very well.
By the way, I have a question.
I know that, in Photoshop, they have unique id for each layers.
So, when I use free psd parser library(https://code.google.com/archive/p/java-psd-library/), I can easily get the unique value of each layer.
However, when I checked your API Reference and Developer Guide, I can’t find any unique value from Layer model. (https://apireference.aspose.com/psd/java/com.aspose.psd.fileformats.psd.layers/Layer)
So, I want to ask you

  1. Is there any value (such as unique id) that can differentiate each layer?
  1. If it is, how can I get the value?
  2. Unless, Is there any plan to support this value in your library?

@ericaHong

Can you please explain the requirement that what actually you meant by export layer id from Layer Model. You want to access Layer ID? Please explain the requirements with some more details and scenario please.

@mudassir.fayyaz
Yes, exactly.
I want to access Layer ID, so I try to found some information in the Layer model, but I can’t get it.
I want to get “unique value” for each layers. (It seems like, The each layer of Photoshop have a unique integer type value officially. ref: https://code.google.com/archive/p/java-psd-library/)

@ericaHong

Hello, there is no unique id for the layer in PSD.
But there are some alternatives that can be helpful for you:

  1. You can check id in LyidResource https://apireference.aspose.com/psd/net/aspose.psd.fileformats.psd.layers.layerresources/lyidresource
    But this Id not always unique.
  2. You can use Layer Order Position in PSD File. In this case, you will get issues if you insert or remove layers.
  3. Also, we are working on a feature that can be helpful for your tasks. You can track this issue by its ID PSDNET-940. Create a specific method to get a unique hash for similar layers in different files.

@DmitriySorokin
Wow…!! Thanks for your answer =)
It helps me a lot. I will use the values you recommended.
I sincerely look forward to getting the unique value that you are now working in PSDNET-940.

Thanks again!