View Single Post
Old 10-23-2012, 06:08 PM   #16
hanktmg
Junior Member
hanktmg began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Oct 2012
Device: Nook Simple Touch
Remove files from epub

I know this is a two-year-late response, but I figured I would share my solution to the OP's problem. Simply removing the image tag doesn't remove the images from the epub. To remove all images or any file name/type from epubs (and therefore reducing the file size), you need a bulk file renamer (such as ant renamer), 7zip, and either a Windows OS or knowledge of CLI.
  1. Change the extension of all epub to zip using Ant Renamer or other bulk file renamer.
  2. Run this in command prompt (shift-rightclick in directory of epubs), substituting whats in parenthesis with your own:
    Code:
    for /r %x in (*.zip) do "PATH TO 7ZIP.EXE" d -r "%x" "FILETYPES OR FILENAMES TO REMOVE"
  3. Change the extension of zip files back to epub.
  4. (Optional) Remove the image tags using Calibre.
*Note: *.EXTENSION includes ALL files of that extension, so *.jpg will remove all images and covers within the epub files, but not outside of the epub files. This command will run on all files within the directory, so be sure to backup your library/files before attempting.

An example of the commands I used is:
Code:
for /r %x in (*.zip) do "C:\Program Files\7-Zip\7z.exe" d -r "%x" *.jpg *.png *.jpeg *.gif *.pdf
hanktmg is offline   Reply With Quote