Need help making action to square crop to clipping path.
I feel this should be so simple but every action I create just will not work on the next image I open. Basically I have all these images of sockets that are currently all square cropped but they are not cropped tight into the image. Every image has a clipping path and the background is dropped out to white. I want to create an action that will select the clipping path, crop to the edge of the clipping path, maybe give a 2 or 3-pixel buffer, and then crop back to square where the object is centered. Any ideas or help?
Images currently look like this - https://imgur.com/quNF3nu
want them to look like this - https://imgur.com/Lo8TyQn
I have about 900 total images to do this too.
THANKS!
