Return to Snippet

Revision: 12179
at March 4, 2009 21:43 by Dorgendubal


Initial Code
find SOURCE_DIR -print -name "*.jpg" -execdir convert -resize 800x800 -quality 80 '{}' 'TARGET_DIR/{}' \;
find Pictures/ -print -name "*.jpg" -execdir convert -resize 800x800 -quality 80 '{}' '/tmp/test/{}' \;

Initial URL

                                

Initial Description
* Resized images are generated into TARGET_DIR.
* Change the resolution (800x800 in my example) and quality (80) as you want.
* The command keeps the image's proportion. 1600x1200 will be converted into 800x600, 1200x1600 into 600x800.

_Notice_: the command does also resize images in sub-directories but put them in the same target directory (overwrites any existing file).

Initial Title
Resize all images in directory

Initial Tags
resize, image, Bash, convert

Initial Language
Bash