Skip to content

Instantly share code, notes, and snippets.

@connrs
Created December 23, 2018 19:14
Show Gist options
  • Save connrs/e0d556259bf7107a1c5ed5ae2aa5ed6f to your computer and use it in GitHub Desktop.
Save connrs/e0d556259bf7107a1c5ed5ae2aa5ed6f to your computer and use it in GitHub Desktop.
Random find with imagemagick shit
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