Last active
November 25, 2021 23:40
-
-
Save MInner/d31604fb0b10c25a99dfe414ba3406eb to your computer and use it in GitHub Desktop.
prepare_images_for_arxiv.sh
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
find . -name '*.png' | while read line; do echo ${line}; convert -resize 70% ${line} ${line}.small.png; pngquant --speed 1 ${line}.small.png -o ${line}.quant.png; done | |
find . -name '*.small.png' | while read line; do rm $line; done | |
read -p "Press [Enter] if you are happy with *.quant.png images, otherwise press Ctrl-C." | |
find . -name '*.quant.png' | while read line; do mv ${line} ${line:0:-10}; done | |
for EXT in png pdf; do find -name "*.${EXT}" | while read line; do echo $line; done; done | while read line; do if ! grep -q -r --include \*.tex ${line#*/} .; then echo ${line}; rm ${line}; fi; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment