chinedufn / psd

A Rust API for parsing and working with PSD files.
https://chinedufn.github.io/psd
Apache License 2.0
265 stars 40 forks source link

Photoshop groups support #10

Closed tdakkota closed 4 years ago

tdakkota commented 4 years ago

Layer should have group_id field.

chinedufn commented 4 years ago

This is in the image resources section which we haven't started parsing - https://github.com/chinedufn/psd/blob/cd3b04af2e91b5645dfe29a932c3005087d39e94/src/sections/mod.rs#L89

tdakkota commented 4 years ago

Well, I did a little research. Groups are present as two layers with Section divider setting (Photoshop 6.0) tagged block and with layers between them.

image

So, a simple PSD file with one layer inside group have this structure(layers are present in reverse order, you know):

- name: </Layer group>, with tag `lsct`, divider_type is 3 (bounding section divider)
- name: First Layer, without tag `lsct`
- name: group, with tag `lsct`, divider_type is 1 (open folder)

image

chinedufn commented 4 years ago

Ah nice - so layers are surrounding by an open and close tag.

Nice find!