Photoshop: Parsing smart object following PSD File Format

  • 1
  • Question
  • Updated 3 months ago
  • (Edited)
I am doing the job that parsing the PSD files on web, and I read all the data by following https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/. Now I am given a task to get the original image source of a smart object when there is an image placed into the PSD.

I have already parsed 'Placed Layer' and 'Linked Layer' and just gotten the size, name and some other information of the original image. But I didn't find the image data to render the complete image.

I will be appreciate if anyone can give me some suggestions.
Here are the datas I have already read:
Photo of kuku zz

kuku zz

  • 5 Posts
  • 2 Reply Likes

Posted 4 months ago

  • 1
Photo of Max Johnson

Max Johnson, Champion

  • 620 Posts
  • 332 Reply Likes
The smart object is literally a separate file that you have to open and parse. For linked, that's another file on disk... for embedded, it is kind of like it's zipped into the psd. I've been able to access it with javascript actionmanager code

(incomplete code here)
...var desc = new ActionDescriptor();
        executeAction(s2id('placedLayerEditContents'), desc, DialogModes.NO);
Hope that helps you get on the right track...
Photo of kuku zz

kuku zz

  • 5 Posts
  • 2 Reply Likes
I found a package which parsing with python code and got what I just want. The official document ignores the key data.

Anyway, thanks for your help. It's very nice of you.
Photo of Max Johnson

Max Johnson, Champion

  • 604 Posts
  • 318 Reply Likes
Thanks for the follow up. Can you share the link to the code you found?
Photo of kuku zz

kuku zz

  • 5 Posts
  • 2 Reply Likes
Sorry, I learned from this library https://github.com/psd-tools/psd-tools