Resize all images in directory


/ Published in: Bash
Save to your folder(s)

* 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).


Copy this code and paste it in your HTML
  1. find SOURCE_DIR -print -name "*.jpg" -execdir convert -resize 800x800 -quality 80 '{}' 'TARGET_DIR/{}' \;
  2. find Pictures/ -print -name "*.jpg" -execdir convert -resize 800x800 -quality 80 '{}' '/tmp/test/{}' \;

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.