Converting of photos
Many of modern digital cameras are saving there photos with maybe 7 or 10 mega pixel. As good as this is for archiving and backup, it's not usable for publishing picures to the internet. For this situations there can be a script very helpful, that resizes all pictures from inside a directory. Something like this:
#!/bin/sh
for i in *.JPG;
do
echo $i
convert -scale 550x550 $i $i
done
This script is searching for every picture that ends with .JPG inisde the current directory, convert and scale it to a size where the biggest side is 550 pixel long and save it by using the same name.
If you want to backup your pics before saving the resized one, you can add a cp execution to the script
#!/bin/sh
mkdir backup
for i in *.JPG;
do
echo $i
cp $pic ./backup
convert -scale 550x550 $i $i
done
This little script creates at the beginning a backup folder inside the current directory and copies every picture in during iteration over the given files
The tool convert is part of the imagemagick package.




