Created
November 3, 2012 13:21
-
-
Save aeakett/4007370 to your computer and use it in GitHub Desktop.
optimize cbr and cbz files
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
# remove all the yucky characters from the file names and dump them in a dir | |
mmv '*.cbz' '#1.zip' | |
mmv '*.cbr' '#1.rar' | |
for i in *.zip; do mkdir $i.dir; unzip $i -d $i.dir; done | |
for i in *.rar; do mkdir $i.dir; unrar e $i $i.dir; done | |
# drag and drop all of the images into ImageOptim | |
# also check for extra pages with ads or other crap you don't need | |
for i in *.dir; do zip -9 $i.zip ./$i/*; done | |
mmv '*.*.dir.zip' '#1.cbz' | |
rm *.zip | |
rm *.rar | |
rm -r *.dir |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment