Skip to content

plug-ins: multi-layer support in PSD load/export.

Jehan requested to merge wip/Jehan/PSD-multi-layer into master

We now have multi-layer selection support and so has Photoshop. But I am unsure if this information is stored in PSD. Apparently (looking at our code), we tag our active layer with 0x0400 flag ("Layer state information" in the PSD docs).

But it is completely unsure to me if this tag can be set several times with the meaning of all these layers are selected. This MR implements this. It works within GIMP (I can export to a PSD file then reimport and the selected layers are right). But I don't have Photoshop and can't test.

Note that I have tested in Krita and some online software (Photopea) but either they don't properly use this tag or it cannot be used multiple times like this. Note that even the old code, when setting only a single layer with this tag, these 2 third-party software were not even selecting the tagged layer. So I'm not even sure we use this right at all.

Well at the very least, the files with multiple "Layer state information" tags are still loaded fine in these 2 other software (except for layer selection state, that is). But before pushing, I would love for someone to test in Photoshop.

@Wormnest You were telling me you don't have Photoshop either, but since you are kind of our file format biggest contributor lately, maybe you have some insight to provide. 🙂

Edited by Jehan

Merge request reports