Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
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
Old 09-28-2013, 05:26 PM   #17
vugtitan
Addict
vugtitan ought to be getting tired of karma fortunes by now.vugtitan ought to be getting tired of karma fortunes by now.vugtitan ought to be getting tired of karma fortunes by now.vugtitan ought to be getting tired of karma fortunes by now.vugtitan ought to be getting tired of karma fortunes by now.vugtitan ought to be getting tired of karma fortunes by now.vugtitan ought to be getting tired of karma fortunes by now.vugtitan ought to be getting tired of karma fortunes by now.vugtitan ought to be getting tired of karma fortunes by now.vugtitan ought to be getting tired of karma fortunes by now.vugtitan ought to be getting tired of karma fortunes by now.
 
Posts: 299
Karma: 1042776
Join Date: Aug 2010
Device: none
Quote:
Originally Posted by cybmole View Post
is there an option anywhere to strip all images from epub, mobi....

the only place I can find a no images option is in PDF input options.

if I have some other ebook format, which has unwanted images , how can I auto-strip them?
SIMPLE.

VERY SIMPLE.

convert it to a text or rtf.

convert back to epub.

simple.
vugtitan is offline   Reply With Quote
Advert
Old 12-16-2017, 11:17 AM   #18
iamno1monarch
Junior Member
iamno1monarch began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Dec 2017
Device: kindle paperwhite
Quote:
Originally Posted by vugtitan View Post
SIMPLE.

VERY SIMPLE.

convert it to a text or rtf.

convert back to epub.

simple.
Thanks That Worked Like a CHARM
iamno1monarch is offline   Reply With Quote
Old 12-16-2017, 11:20 AM   #19
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,645
Karma: 127838196
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by iamno1monarch View Post
Thanks That Worked Like a CHARM
Do you want to lose the formatting? It would be easy enough to edit the eBook in Calibre's eBook editor to remove the images.
JSWolf is offline   Reply With Quote
Old 10-16-2019, 02:16 AM   #20
Gudrune
Junior Member
Gudrune began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Oct 2019
Device: Kindle
Quote:
Originally Posted by JSWolf View Post
Do you want to lose the formatting? It would be easy enough to edit the eBook in Calibre's eBook editor to remove the images.
Thank you! Had the same problem, worked like a charm.
Gudrune is offline   Reply With Quote
Advert
Old 03-12-2024, 07:02 AM   #21
technicaltitch
Member
technicaltitch began at the beginning.
 
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.
technicaltitch is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

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


All times are GMT -4. The time now is 09:42 AM.


MobileRead.com is a privately owned, operated and funded community.