Skip to content

Instantly share code, notes, and snippets.

@zulhfreelancer
Last active February 6, 2019 22:29
Show Gist options
  • Save zulhfreelancer/4734a198c83bb9eac34bbfff4ca35051 to your computer and use it in GitHub Desktop.
Save zulhfreelancer/4734a198c83bb9eac34bbfff4ca35051 to your computer and use it in GitHub Desktop.
How to resize photos size in bulk using CLI/Terminal?
$ cd /path/to/photos/folder
$ image-batch-resizer --directory . --size 500 --remove-original-file yes

To auto-rename res_xxx.jpg to xxx.jpg (original file name), run:

for i in "res_"*;do mv "$i" "${i#"res_"}";done

$ cd /path/to/photos/folder
$ image-batch-resizer --directory . --size 500 --remove-original-file yes && for i in  "res_"*;do mv "$i" "${i#"res_"}";done

If you have Terminal alias called ibr, this is the shorter version of the command above:

$ ibr -d . -s 500 -R yes && for i in  "res_"*;do mv "$i" "${i#"res_"}";done

Dependencies

  • brew install imagemagick
  • yarn global add image-batch-resizer

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment