10-23-2012, 06:08 PM | #16 |
Junior Member
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.
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 |
09-28-2013, 05:26 PM | #17 | |
Addict
Posts: 299
Karma: 1042776
Join Date: Aug 2010
Device: none
|
Quote:
VERY SIMPLE. convert it to a text or rtf. convert back to epub. simple. |
|
12-16-2017, 11:17 AM | #18 |
Junior Member
Posts: 1
Karma: 10
Join Date: Dec 2017
Device: kindle paperwhite
|
|
12-16-2017, 11:20 AM | #19 |
Resident Curmudgeon
Posts: 74,033
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
|
10-16-2019, 02:16 AM | #20 |
Junior Member
Posts: 1
Karma: 10
Join Date: Oct 2019
Device: Kindle
|
|
03-12-2024, 07:02 AM | #21 |
Member
Posts: 20
Karma: 10
Join Date: Jul 2011
Device: Sony PRS 350
|
I didn't like losing the contents index and page breaks of converting to rtf and back. I'm running on Ubuntu, this also works on macOs. My reader stopped applying `img {display:none;}`, I needed CLI, this just deletes all the images then rezips:
``` # takes the recipe name as $1 # create epub as, eg, 20240312_The Register.epub, with images: ebook-convert "$1".recipe $(date +%Y%m%d)_"$1".epub # make working directory mkdir "$(date +%Y%m%d)_$1" # unzip epub unzip "$(date +%Y%m%d)_$1.epub" -d "$(date +%Y%m%d)_$1" cd "$(date +%Y%m%d)_$1" #delete all images find . -name "*.jpg" -exec rm {} + find . -name "*.png" -exec rm {} + # delete old epub rm "../$(date +%Y%m%d)_$1.epub" #rezip zip -X0 "../$(date +%Y%m%d)_$1_noimg.epub" mimetype zip -X9Dr "../$(date +%Y%m%d)_$1_noimg.epub" * -x mimetype # delete working directory rm -r "$(date +%Y%m%d)_$1" ``` Save this as `download_without_images.sh`, `chmod +x` it, then call, eg: ./download_without_images.sh "The Register" Last edited by technicaltitch; 03-12-2024 at 07:05 AM. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Remove Page Break after Images | luthar28 | ePub | 17 | 04-05-2017 03:16 PM |
Remove all images and Covers? | Pselus | Calibre | 4 | 03-18-2015 02:47 AM |
HTML + Images = MOBI without Images | SunLight | Amazon Kindle | 5 | 08-25-2012 02:27 PM |
Remove Books - Restoring Confirm to remove books | Caffey | Calibre | 6 | 09-20-2010 09:23 AM |
RFE: Remove remove tags in bulk edit | magphil | Calibre | 0 | 08-11-2009 10:37 AM |