Created
December 23, 2018 19:14
-
-
Save connrs/e0d556259bf7107a1c5ed5ae2aa5ed6f to your computer and use it in GitHub Desktop.
Random find with imagemagick shit
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
find . -type f -iname '*.jpg' | while IFS= read -r f; do | |
_format=$(identify -format '%m' "$f"); | |
if [[ $_format == "JPEG" ]]; then | |
echo 'File: '$f | |
ls -lh "$f" | awk '{print $5}' | |
mogrify -quality 78 "$f" | |
ls -lh "$f" | awk '{print $5}' | |
exit 0 | |
fi | |
#echo "$f|"$(identify -format '%m' "$f"); | |
done | |
find . -type f -iname '*.jpg' -mtime "+730" | while IFS= read -r f; do | |
_format=$(identify -format '%m' "$f"); | |
if [[ $_format == "JPEG" ]]; then | |
echo 'File: '$f | |
ls -lh "$f" | awk '{print $5}' | |
mogrify -quality 78 "$f" | |
ls -lh "$f" | awk '{print $5}' | |
exit 0 | |
fi | |
#echo "$f|"$(identify -format '%m' "$f"); | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment