Posts Tagged ‘bash’

Resize and auto orientate pictures

February 9th, 2009 No comments

If you have a linux system with ImageMagick, you can easily resize and auto orientate pictures with a bash script.

Just create a file called with the following content:

list=`find $path*`

for file in $list; do
        echo $file
        convert -auto-orient -resize $size $file $file
exit 0

And give it execute rights.
When you call “./ 1024 /home/user/pictures/” every picture in /home/user/pictures will be auto-orientated and scaled to a max height or width of 1024 pixels. The auto-orientate is done by looking at the exif info.