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

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 04-24-2015, 08:14 PM   #1
johnb0647
Nameless Being
 
Batch remove multiple covers?

CALIBRE v2.23
LINUX MINT (CINNAMON) 17.1

I've been collecting ebooks since the "Neuvomedia Rocket" (1998) so I've had to convert format's a number of times which may have contributed to this issue.

Now my "standard" is epub.

I've noticed that I have hundreds of titles that Calibre doe not recognize as having a cover <therefore showing the generic cover> BUT when I open the book there IS a cover image..... in many cases two or more copies of the same image. NOTE: re-checking a representative original MOBI format shows the images already there so they apparently did not appear as an artefact of the CALIBRE MOBI > EPUB conversion.

Opening a representative title with "edit ebook" shows:

1. titlepage.xhtml
2. index_split_000.html
3. index_split_001.html
... <more sections containing text>

Where these first three "sections" contain the same image (with different coding including references to Calibre), yet Calibre shows a generic cover.

SEE BELOW FOR EXAMPLE OF HTML CODING.

In some cases the total (storage) size (in mb) of the covers exceeds the size of the text portion of the document.

I can manually eliminate this by:
A. Open the epub as a zip, extract a copy of the cover and del the image files.
B. In Calibre, "edit ebook" and delete all the "sections" containing cover image references.
C. In Calibre, "edit metadata" and add the extracted cover.
D. In Calibre, "convert" epub to epub (eliminates references to absent images)

This is not practical for hundreds of ebooks.

Any suggestions for an automated way to do this?

NOTE: I have no evidence this is a "bug" in Calibre since the multiple images were present in the original files before conversion (mobi to epub). It's possible the appeared in earlier conversions but since I cannot examine the code I can't verify it.

For now I'm interested in a fix.

EXAMPLE:

titlepage.xhtml

<?xml version='1.0' encoding='utf-8'?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta name="calibre:cover" content="true"/>
<title>Cover</title>
<style type="text/css" title="override_css">
@page {padding: 0pt; margin:0pt}
body { text-align: center; padding:0pt; margin: 0pt }
div { padding:0pt; margin: 0pt }
img { padding:0pt; margin: 0pt }
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head>
<body>
<div>
<img src="images/calibre_cover.jpg" alt="cover" style="height: 100%"/>
</div>
</body>
</html>

index_split_000.html

<?xml version='1.0' encoding='utf-8'?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Die Trying - Reacher 02</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link href="stylesheet.css" rel="stylesheet" type="text/css"/>
<link href="page_styles.css" rel="stylesheet" type="text/css"/>
</head>
<body class="calibre">
<div class="calibre1">
<p class="calibre_"><img src="images/00002.jpg" class="calibre_1"/></p>
<div class="calibre1"></div>
<div class="mbp_pagebreak" id="calibre_pb_0"></div>
</div>
</body></html>

index_split_001.html

<?xml version='1.0' encoding='utf-8'?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Die Trying - Reacher 02</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link href="stylesheet.css" rel="stylesheet" type="text/css"/>
<link href="page_styles.css" rel="stylesheet" type="text/css"/>
</head>
<body class="calibre">
<div class="calibre1">
</div>
<div class="calibre1">
<p class="whitespace"> </p>
<a></a>
<p class="whitespace"> </p>
<a></a>
<p class="calibre_"><img src="images/00001.jpg" class="calibre_2"/></p>
<div class="calibre1"></div>
<div class="mbp_pagebreak" id="calibre_pb_1"></div>
</div>
</body></html>

Last edited by johnb0647; 04-24-2015 at 08:17 PM.
  Reply With Quote
Old 04-24-2015, 10:42 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,835
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
If you wish to set the cover in calibre form that within the ebook simply select all books, click edit metadata and use the set cover from ebook file option.
kovidgoyal is offline   Reply With Quote
Advert
Old 12-08-2018, 01:44 AM   #3
Miriam English
Junior Member
Miriam English began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Dec 2018
Device: Android
I know this is a really old thread, but I've been trying to do exactly the same thing and had hoped to find a solution here. Well, I believe I've solved it, so I figure it's only right to share the solution.

To remove the cover from an ebook I've successfully used Calibre's ebook-meta command like this:
Code:
ebook-meta "some ebook.epub" --cover="/dev/null"
It isn't suggested anywhere in the documentation. I tried all sorts of other things which failed. It feels like a bit of a hack, but it really does seem to work. If someone finds a better way please let us know.

If you want this to ripple through a directory of epub ebooks, you could do something like this:
Code:
for f in *.epub ; do ebook-meta "$f" --cover="/dev/null" ; done
-----------------------

Edited later:

Oh dear... I just found at least one ebook that won't let me remove the cover by the above method.

Last edited by Miriam English; 12-08-2018 at 06:01 AM.
Miriam English 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 embedded covers Angelo Mascaro Calibre 24 11-07-2015 07:37 PM
Remove all images and Covers? Pselus Calibre 4 03-18-2015 02:47 AM
How to batch add books stored in multiple zip files? atkach Library Management 3 10-12-2014 01:39 PM
How can I blank margins of picture batch remove? asdas Workshop 2 07-11-2012 04:26 PM
Remove white border (batch) OS X etherspin Workshop 0 03-14-2009 08:55 PM


All times are GMT -4. The time now is 08:30 AM.


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