Home » epubs » How to remove pictures from epub files in Windows.

How to remove pictures from epub files in Windows.

Start here

I have a Nook, and I love it, but it shows pictures as teeny tiny things, so I don’t get much benefit from them. The Nook also cannot use any fonts embedded in a book, always using instead its own built in fonts. Those pictures and fonts increase the file size of a book, meaning there is less room for more stuff in the limited space of the Nook. So I like to remove all pics and all fonts from an epub book before transferring it to the trusty old Nook.

If one has dozens or hundreds of books, each perhaps tucked away in its own subfolder, as Calibre stores them, it would be nice to be able to get rid of all the pics and all the fonts in all the books in one swoop.

Here’s how I did it.

Step 0. Installed the freeware program 7zip, from here. [Second one in the list].

Step 1. Created a new .bat file, called nopix.bat, in the folder containing the epubs.

Step 2. Copied the following into the nopix.bat file, and saved.

forfiles /S /M *.epub /C “cmd /c rename @file @fname.zip”
for /r %%x in (*.zip) do “C:\Program Files\7-Zip\7z.exe” d -r “%%x” *.jpg *.png *.jpeg *.gif *.pdf *.ttf
forfiles /S /M *.zip /C “cmd /c rename @file @fname.epub”

Step 3. Clicked on the nopix.bat file.

Tadum!

Notes:

1. The above removed all pictures, including the covers, from the epub files,

2. It removed pics from all the epubs in the folder which contained the .bat file, including those in subfolders

3. This procedure is irreversible, so I first make backups [in a completely different folder] just to be sure.

 4. I saw that key middle line [for /r %%x in (*.zip) do “C:\Program Files\7-Zip\7z.exe” d -r “%%x” *.jpg *.png *.jpeg *.gif *.pdf *.ttf] somewhere on the internet, probably at the great Mobileread.com forum. I’d like to credit the person who first revealed it, so let me know who you are.

 


Leave a comment