Home > Coding, Tips & Tricks > Resize and auto orientate pictures

Resize and auto orientate pictures

February 9th, 2009 Leave a comment Go to 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 resize.sh 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 “./resize.sh 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.

  1. No comments yet.
  1. No trackbacks yet.