Agamnentzar / ag-psd

Javascript library for reading and writing PSD files
Other
496 stars 66 forks source link

Adds groups width and height #182

Closed adriancmiranda closed 4 months ago

adriancmiranda commented 4 months ago

May I contribute by adding the width and height properties to the group layers, is it of interest to you guys?

Agamnentzar commented 4 months ago

width and height is not saved in PSD file so it wouldn't make sense to add it here. It would be confusing, because it would create expectation that you need to set it when saving the file. It's also ambiguous what those values should be, some people might want it to be sum of surfaces of all sub-layers, some people might need it to clip the size to clipping group layers or masks. It's better to leave this kind of calculation to the user of the library.

adriancmiranda commented 4 months ago

I see! Yeah, looking at it that way makes sense. I thought about adding it in readPsd only, but I'd need to extend the Layer type to be restricted to that use (to avoid altering the Layer interface) and add a "mode" parameter. Anyways, thanks for clarifying, It really seems like a good decision.