Not to mention your workaround doesn't crop the layer at all, it just deletes what's on the layer to the canvas bounds. If you have a bunch of junk on that layer outside the canvas bounds it's not deleted.
Your request is very actionable. If you email photoshop.forums at . . . gmail.com I can send you the action.
Here's your solution, really once again available already in photoshop
Record an Action… step by step
• With your selection still active Press command J
• Press option left bracket, which will navigate to the original layer
• Delete current layer (delete key)
• Option right bracket
Now this action can be given an F key shortcut, meaning that with the simple press of a key you can crop layers, and anything outside including anything outside the Canvas area.Only issue, it will rename the layer with the word 'copy'
I know its a workaround, but its better than a menu command as far as I can see.
Nice one Mark. You should have seen the action I emailed him. And you can work around layer masks easily enough. If you clear the original layer by applying a blank mask, you can then merge down into it to keep the same name.
Oh yeah, forgot about masks. Reckon its still possible to automate the entire process, would need conditionals (scripting) to establish whether the layer has a mask or not I think.
Well you can do a group, merge, then load layer transparency. I think you can avoid conditionals by saving original layer trans and then doing math to this new group merge layer trans.
doing math to this new group merge layer trans.
? Understand the rest, but what does that mean?
I just mean if you group, merge the layer and subtract the original layer trans from this new layer trans, you parse out a non-conditional layer mask selection. It doesn't stop you from creating a white mask for a layer that never had one. That part is left for scripts, I think.
you parse out a non-conditional layer mask selection
OK, after banging my head several times, again I was unable to obtain sufficient blood flow to understand that one. I think its possible too by activating the mask, select canvas, and then copying and pasting the active area layer mask into the new mask . Like you and I said, conditionals would really be required to determine mask or no mask. Or two actions
Lets face it, maybe the posters initial request is a good one - useful feature request! Could work on Groups too, eliminating pixels outside canvas area for all containing layers
Layer 1 is the original. With or without a mask. Action doesn't know.
1 Save "layer 1" trans
2 Duplicate "layer 1"
3 Create a new "layer 2" on top and fill with select all
4 Merge down preserving the mask (action must be recorded with a masked layer, but won't choke when run on a bare layer)
5 Put layer 1 copy in "group 1" and merge "group 1"
Layer "group 1" trans is the mask trans
I think you're right, I was full of it before but this is rock solid.