This blog has moved

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

« December 2012 | Main | February 2013 »

January 2013 Archives

January 10, 2013

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.

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.

About January 2013

This page contains all entries posted to Marnie, speak! Good girl. in January 2013. They are listed from oldest to newest.

December 2012 is the previous archive.

February 2013 is the next archive.

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