
: Re: How can I reduce the resolution of images in an epub or mobi file? Some of the last O'Reilly ebooks I got have become really large (e.g. 60MB for the mobi version and 5.5MB for the epub
Note: I intended to leave this as a comment for @mosh but didn't have the necessary rep. This is my own personal solution based on the solution he outlined. This will recursively scan a specified directory and compress files larger than 49MB, overwriting the original files. [I chose that size due to the fact that Google Play Books uploads are limited to 50MB in size, and that's the service I utilize most frequently, generally with uploads from my Humble eBook Bundle purchases.]
First file: shrinkemall.sh
#!/usr/bin/bash
USAGE="Usage: [CO] directory"
: ${1:?$USAGE}
find -size +49M
-exec ./shrinkemall1.sh "{}" ;
Second file: shrinkemall1.sh
unzip -d tmp ""
cd tmp
find . -type f -iregex '^.*[.](jpg|jpeg|png|gif)$'
-exec mogrify -quality 85 -resize '800x800>' {} ;
zip -Duro "../" .
cd ..
rm -rf tmp
Obviously you'd want to edit the parameters to suit the service and/or device you're targeting.
Thanks, @mosh !
Free books android app tbrJar TBR JAR Read Free books online gutenberg
More posts by @Radia

: Kindle Oasis: increase contrast for non-black text and images I have a Kindle Oasis where the text and image contrast is normally great. But now I'm reading a book (ironically it's Universal

: Does using DC superhero images in a fan/trivia ebook consitute infringement? The ebook will be a compilation of Fan facts and trivia. some part of the book i will be using images from DC characters.