I've noticed that layerbounds get reported back differently if they have layer effects on them. Is this just CS2 (which got fixed in later versions)?
To explain:
Do the following in PS. New image, new layer, select a rectangle, fill it with colour. Add an effect - say outer glow set to normal about 5 pixels, colour is irrelevant. Hide the background. Select all. Copy merged and paste in the image.
So we have two layers - one with a rectangle with an outer glow effects layer, and another identical layer (only the effects layer has effectliy been rasterised)
The following script should report back that they are the same width and height.
app.preferences.rulerUnits = Units.PIXELS;
var srcDoc = app.activeDocument;
var numOfLayers = srcDoc.layers.length;
for (var i = numOfLayers -2; i >= 0 ; i--) //ignore background
{
temp = srcDoc.layers[i].bounds
var x = temp[0].value
var y = temp[1].value
var x1 = temp[2].value
var y1 = temp[3].value
var W = (x1 - x)
var H = (y1 - y)
alert ("Layer: " + srcDoc.layers[i].name + " W,H: " + W + ", " + H + "\n");
}
Only it doesn't. Why?
Because the layer pixels are different. One layer has some pixel content the Other layer may havs some the same content with addional pixels that extend past the visible pixels in the original layer addded by applying the the style associated with the other layer. A layer style is not part of the layers content and how it applies depends on the setting and options set in the layer style and on the style visibility setting and may also be effectef by the layer's layer masks. Layer content Layer style and layer mask are seperate. These along with and along with blending mode, layers opacity, fill and blend determine how a layer is rendered. The composit layer created by the copy merge bounds may well be different then the bounds of the original layer. Smaler, Larger, same and diffrent aspect ratios are all posible. Bounds is related to a layers pixel content. These may be visible of not because of a layer mask or because they extend out past the documents canvas size. A copy merge layer will not be larger then canvas size
North America
Europe, Middle East and Africa
Asia Pacific