This blog has moved

The blog can now be found here, including all the archives and tutorials. Subscribe to the RSS feed here.

« Can we grep about Photoshop | Main | Happy birth-ish-day to my favorite detstructobot »

Can we grep about Photoshop

This is sort of a strange blog post as it's not really knitting related, has no puppies and addresses an obscure problem that most people will never have, but I'm of the mind that if I know how to fix a problem I've had, there's bound to be someone else out there with the same problem so I might as well share.

Our website's online ordering application accesses files stored in a series of folders. Within the folders, all the naming conventions are the same. The folders themselves are all numbered, though not sequentially. We had 1000 folders and within each folder is an image called, "sample.jpg" and each of those images is a preview of the product being sold, so they are all different. We wanted to open all those files and use Photoshop's Save for Web function to optimize them. However, Save For Web doesn't remember the image's source folder. It remembers the last place Save For Web saved to, which means if you were to batch process the images, each would overwrite the last in some common folder. Even if we numbered the images, sequentially, they wouldn't match up with their folder number since the numbers all jump around. Any solution I could think of ended up being pretty labor intensive with plenty of chance for error.

I posted on the Adobe Forums and got bupkis.

I figured I had nothing to lose and posted on Facebook. A few hours later, a friend in Australia had a solution for me.

I decided to do up more detailed instructions, suitable for someone who has never worked with unix, grep, or scripting before. You can download the instructions and sample files from this page. Please note that these are Mac specific instructions. Pretty much everything should translate to some sort of PC equivalent, but I'm not the person to help you sort that out.

I could see this being handy for anyone who has a lot of image files on their site that they might want to resize or optimize, quickly.

If you think any of this would be useful, feel free to download the files and don't hesitate to let me know if you have any tips, corrections or suggestions.

Share this post

About

This page contains a single entry from the blog posted on January 10, 2013 5:05 AM.

The previous post in this blog was Can we grep about Photoshop.

The next post in this blog is Happy birth-ish-day to my favorite detstructobot.

Many more can be found on the main index page or by looking through the archives.

Site Info

Powered by
Movable Type Pro 5.14-en