Question
Photoshop scripting: Real pixel size of a layer
This function alows to get the real size of a layer, for example if you had several layers inside a group and some are invisible, this will not take in the consideration for the size, or the case of a text paragraph which the text area can have two line of text, but is fill only with one, will return the size of one line, not the complete textarea.
function getMinimunBoundOfVisibleLayers(layer, bounds) {
var merged = layer.duplicate().merge();
var bounds = Object.clone(merged.bounds);
merged.remove();
return bounds;
}
