Reduce photo sizes

I find myself needing to reduce photo sizes very often these days. Thanks to my 4 days old son and new 14 mega pix camera – Cannon PowerShot SX210IS.  I threw a script together quickly to process whole jpg folders in one shot. Now I can upload/email much faster. I use SugarSync for long term archival.


#!/bin/bash

echo -e "\nReduces the size of all jpg files in the current dir to 20% of original"
echo -e "You must have imagemagick installed"
echo -e "=========================================================================\n"
echo -e "New images will be placed in subdirectory named 'small'\n"

if [ ! -e "small" ]
then
mkdir small;
fi

for file in *.jpg;
do
echo converting "$file"
convert "$file" -resize 20% small/"$file";
done
echo "Finished"

Advertisements
This entry was posted in Tech bits. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s