Created
June 14, 2012 16:08
-
-
Save julianduque/2931214 to your computer and use it in GitHub Desktop.
Bash script for resize and set quality to jpg images (works with sips on Mac OSX)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for file in *.jpg | |
do | |
sips --resampleHeightWidthMax 1357 --setProperty formatOptions 80 $file | |
done; |
you can also do:
sips --resampleHeightWidthMax 1357 --setProperty formatOptions 80 *.jpg
With multiple subdirectories and spaces in filenames:
find . -name '*.jpg' -print0 | xargs -0 -L 1 sips --resampleHeightWidthMax 1357 --setProperty formatOptions 80
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Amazing! Thank you for sharing this