Known Participant
October 3, 2025
Answered
How to get the real size of the current layer
- October 3, 2025
- 2 replies
- 539 views
var layer = app.activeDocument.activeLayer;
var Width = layer.bounds[2] - layer.bounds[0];
var Height = layer.bounds[3] - layer.bounds[1];
alert(Width + "\n" + Height)The dimensions obtained by the above code are 207 and 765, but the actual dimensions are 567 and 850, because the image contains transparent areas. How can I get the actual dimensions? Thank you, everyone
