Often I find myself having to do a lot of bulk image processing when I'm working on websites: resizing a bunch of pictures to a certain width or height, color adjustments, and sharpening, usually. It can be the most mind-numbing part of my work, and I'm always looking for ways to avoid that.
In Photoshop, you can use actions to help you automate a lot of repetitive work. However, the shortcoming I've found with actions is their lack of conditional behavior. For example, let's say I have a big batch of images, some portrait-oriented (taller than they are wide) and some landscape-oriented (vice versa), and I want to resize each of them to fit within a 500 x 500 pixel square. If the image is portrait-oriented, then I need to resize proportionally, setting the height to 500 pixels. If it's landscape-oriented, then I should resize proportionally with a 500 pixel width, instead of height. I've never found a good way to do this with a single action. But where actions fail, JavaScript comes to the rescue. read more »