In Javascript , how to crop the canvas from layer mask bounds ?
Hello, despite all my researches i am struggling on this, i need to export multiple crops of an image, determined by the layers in the group "Gp CADRAGE".
I need to either :
- get the layermask active, invert it, and then crop to bounds of the mask
- or get a selection of the layer mask of active layer, invert it, and then crop to doc.selection.bounds
I tried to get a selection from the layer mask and then invert it, but i cannot select the layer mask propertly.
I tried to invert the alpha channel but i cannot get the alpha channel of the layer mask active.


I suppose that we can do it with actiondescriotor and actionreference etc, but don't understand how it works yet. So didn't get the code i found on the net to work 🙂
Thanks a lot if you can help me !
Martin
