Setting a cover image on an ePub ebook

As some of you may already know, I recently received a Barnes & Noble Nook for Christmas. This has been a great gift and I’m thoroughly enjoying using it to read a lot more literature, but there’s a problem that has been recurring: some publishers don’t properly set the cover art on an e-book, meaning the cover doesn’t show up on my Nook. Since, for me, everything really should be perfect (it’s a disease, trust me), I have been attempting to rectify this problem with my ebooks and I’ve finally come upon the solution. It’s fairly simple to do, as long as you’re a little comfortable with editing in HTML.

The first thing to do if you’re having trouble is to download Calibre and install it. Calibre is a fairly clunky piece of open-source software but it’s very full-featured and allows for ebooks to be edited. Once you’ve installed Calibre, run it and drag the problematic ebook into the library. Now, there are two ways to proceed. One way is to click ‘Edit Metadata’, set the correct cover image and then convert the file into an epub; Calibre will embed the correct cover image into the new file. However, this method doesn’t sit well with me and so I’m going to outline how I do it below.

Right-click on the ebook and click ‘Tweak Book’, then click ‘Explode Book’. Look for a file that ends in ‘.opf’ (this will probably be in a folder called OEBPS) and open this file in your favourite text editor.1 There will be, somewhere in this file, a line that says <manifest>. You want to find the ID of the cover within this tag. It’ll probably be something like

<item id="cover_image" href="cover.jpg" media-type="image/jpeg">

and so the ID is cover_image in this case. Now go up to the <metadata> tag and insert a piece of text before the end:

<meta name="cover" content="cover_image"/>

This will let the ePub file know where the cover image is contained, and should therefore show up properly on your Nook.


  1. I use TextWrangler on my Macs and Notepad++ on my PCs; your mileage will vary. 

  • http://fredtilley.wordpress.com/ Fred

    Is there a particular reason you don’t like the edit metadata option?

  • http://www.chickensinenvelopes.net/ John Coxon

    If you convert the epub to an epub, Calibre inserts a bunch of its own code everywhere, and I don’t like machine-written code.

  • http://www.chickensinenvelopes.net/ John Coxon

    If you convert the epub to an epub, Calibre inserts a bunch of its own code everywhere, and I don’t like machine-written code.

  • http://www.facebook.com/GaspodeX John Medany

    It’s worth playing with the input output settings a bit on Calibre. Yes it generates code – but book code is fairly straightforward and the amount of work and updates that goes into calibre is quite staggering – its been a labour of love for Kovid Goyal and his team (and well worth the 30 odd quid I’ve donated over the years to the project). Of course the fact that I can remove the DRM from my Nook books, Adobe Epubs and Kindle books is an added bonus (Note they have to be your books – ie you have to have the registered to you reader and credit cards used available on the pc removing the DRM – this is NOT a way of removing DRM from other peoples books).

  • http://www.chickensinenvelopes.net/ John Coxon

    I love Calibre. It’s a very useful piece of software for many reasons. However, for this, I have one of three options:

    1. Do it myself, as above.

    2. Let Calibre do it and have the machine code inserted.

    3. Spend ages tweaking the input/output settings so it replicates the effect of option 1 but means I have to invest extra effort.

    So, I’ll stick with the first option, ta!