Skip to content

Instantly share code, notes, and snippets.

@leonid-shevtsov
Created November 19, 2023 22:20
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
#!/bin/bash
FILES=$(find content static -iname '*.jpg' -size '+1000000c' | comm -23 - .jpegoptimignore)
if [[ $1 = 'do' ]]; then
jpegoptim --strip-com --strip-exif --strip-iptc --size=920 $FILES
else
# lint
if [[ -n "$FILES" ]]; then
echo "Some JPEG files are over 1000000:"
echo -e "$FILES";
exit 1;
else
exit 0;
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment