Last active
February 23, 2018 20:37
-
-
Save kopiro/3e002a2e8dcc1d9101f032178162a0d4 to your computer and use it in GitHub Desktop.
Resize WP uploads in batch
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 | |
images=$(find uploads -type f | egrep -v "\-[0-9]+x[0-9]+\." | egrep "\.(jpg|png)") | |
for f in $images; do | |
echo $f | |
convert "$f" -strip -quality 86 -resize "1800x1800^>" "$f" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment