Created
June 26, 2014 16:39
-
-
Save AndyA/e7a51a05082220a41cd4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
| ind="full" | |
| for sz in "223x293"; do | |
| find "$ind" -iname '*.png' | while read src; do | |
| dst="${src/$ind/$sz}" | |
| if [ "$src" -nt "$dst" ]; then | |
| echo "$src -> $dst" | |
| mkdir -p "$(dirname "$dst")" | |
| tmp="$dst.tmp.png" | |
| convert "$src" -resize "$sz" "$tmp" && mv "$tmp" "$dst" | |
| fi | |
| done | |
| done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment