View Full Version : This book cover just doesn't want to work on Kobo... (Help needed!)


mtrahan
02-24-2013, 05:47 PM
Hi guys,

I have a problem: the cover of a book I'm working on just doesn't want to appear on Kobo. This is a complete mystery to me and I'm getting desperate with this one. I've been adding book covers the same way for a while now and I never had any problem until now.

Here is the cover.xhtml file:
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Couverture</title>

<style type="text/css">
@page {padding: 0pt; margin:0pt}
body { text-align: center; padding:0pt; margin: 0pt; }
div { margin: 0pt; padding: 0pt; }

img.sgc-1 {height: 100%}
</style>
</head>

<body>
<div><img alt="Couverture" class="sgc-1" src="../Images/cover.jpg" /></div>
</body>
</html>

Can you spot any problem in this code? I also add 'Cover' semantics to the xhtml file and 'Cover Image' semantics to the cover.jpg file.

Unfortunately, I cannot post the file here because of copyright, but I could send it to a person or two directly if anyone is willing to take a look at it.

At this point, I must confess that I have absolutely no idea what could cause the problem: this is happening on two books from the same author, same kind of cover image. So I thought maybe the image files are corrupted or something: I tried another image (another cover that is working in another book) and it doesn't solve the problem.

If anyone has any idea, please, please, please let me know.

:help:

Thanks a lot,

Michael

davidfor
02-25-2013, 02:35 AM
What happens on the Kobo device? Is the problem the page display while reading, or the generation of the cover images for use in the library? And which one are you testing with?

From what I can see that is OK, assuming the image is in the place the src property points to. The code I use, cribbed from someone around here, is:

<div>
<svg xmlns="http://www.w3.org/2000/svg" height="100%" preserveAspectRatio="xMidYMid meet" version="1.1" viewBox="0 0 389 640" width="100%" xmlns:xlink="http://www.w3.org/1999/xlink">
<image height="640" width="389" xlink:href="../Images/cover.jpeg"></image>
</svg>
</div>

With the sizes changed to match the image size. That works will on both Kobo devices I have.

I'd be happy to try your file and see what happens. Send me a PM with a location I can get it from or for my email address to send it to.

dgatwood
02-25-2013, 03:31 AM
I notice that you've set all the margins to zero. I've had some serious problems with zero margins on Kobo in iOS before, with text from the following page showing up down the right edge of the page, and no way to reach the final page of the content. YMMV.

Try deleting the zero margins (particularly the zero margins on the body tag) and see if that fixes the problem. If so, please complain to Kobo. :)

mtrahan
02-25-2013, 11:01 AM
My first post wasn't clear: the cover image appears inside the book. My problem is in the library: there is no cover generated, just the blank generic cover. I'm testing this on Kobo app on iPad and also on Kobo Vox. Someone told me my file does the same on a Kobo eInk reader.

I can indeed get the cover generated when using SVG to display it in the xhtml file. I just thought it would be safer on most devices to use just plain (x)html to display it. Am I wrong thinking that?

But most of all, my problem is that I'm really puzzled with this one. I just can't understand why it doesn't work. For example, I tested another book I did, cover displayed in the same way, it works on Kobo: so I just copy-paste the cover.xhtml page from it and bring it in this book. I double-check the semantics, save, transfer it in Kobo apps: it doesn't work! The exact same code I'm using in the previous book doesn't work here for a reason I can't find and it is a complete mystery to me.

I will display the cover using SVG for now, but still, I would really like to understand what is going on here.

Oh and deleting all the margin-stuff in the cover.xhtml file doesn't do anything, dgatwood. I pretty much removed everything—see:

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Couverture</title>
</head>


<body>
<p><img alt="Cover" src="../Images/cover.jpg" /></p>
</body>
</html>

And it still doesn't work!

Oh well.

Thanks a lot for your help, guys. Much appreciated.

davidfor
02-25-2013, 11:28 AM
I have just tested the file with my Kobo Glo, and the cover is generated correctly. The home page shows the new book with the cover, the library list shows the cover and when reading and put the device to sleep, the cover is shown. I can't see any problem with it. My Glo is running the latest firmware, v2.4.0.

I don't have a iOS based device so I can't test that.

The only way I could see this not working on a Kobo e-ink reader is if you put it on as a kepub. This means renaming to have the extension ".kepub.epub". When the Kobo readers see that, they are read using a different reader application and the cover images are not generated.

mtrahan
02-25-2013, 11:47 AM
I have just tested the file with my Kobo Glo, and the cover is generated correctly. The home page shows the new book with the cover, the library list shows the cover and when reading and put the device to sleep, the cover is shown. I can't see any problem with it. My Glo is running the latest firmware, v2.4.0.

I don't have a iOS based device so I can't test that.

The only way I could see this not working on a Kobo e-ink reader is if you put it on as a kepub. This means renaming to have the extension ".kepub.epub". When the Kobo readers see that, they are read using a different reader application and the cover images are not generated.

OK. Good to know. Thanks for the test.

A last thing. About using SVG or not in the cover.xhtml, is there any disandvantage about using SVG?

I just updated the Kobo iOS app (forgot to do it), and the mini-cover is still not generated when NOT using SVG so I guess I will go with SVG for now unless you guys tell me a good reason not to do so?

Thanks again.

Edit: The books already in the app didn't change after the update. But, just in case, I re-uploaded the same old version of the book and the cover now appears! Still a mystery to me, though. And at this point I'm not too sure what I should do: use SVG to be sure that most people get the cover generated in the library?

davidfor
02-25-2013, 10:33 PM
A last thing. About using SVG or not in the cover.xhtml, is there any disandvantage about using SVG?

As far as I can tell it is the recommended way. But, I am not an expert. My fiddling with epubs is purely for my own benefit. Hopefully one of the experts will comment.

I just updated the Kobo iOS app (forgot to do it), and the mini-cover is still not generated when NOT using SVG so I guess I will go with SVG for now unless you guys tell me a good reason not to do so?

Thanks again.

Edit: The books already in the app didn't change after the update. But, just in case, I re-uploaded the same old version of the book and the cover now appears! Still a mystery to me, though. And at this point I'm not too sure what I should do: use SVG to be sure that most people get the cover generated in the library?

It might have been a bug in the old version that wasn't generating the covers properly for the library. The Kobo ereaders generate the covers the first time they are used and then save them for later use. If the iOS app does something similar, it might have generated a default cover and only regenerated it when the new copy of the book was uploaded.

Aerys
02-26-2013, 03:31 AM
The disadvantage on using SVG in the cover.xhtml is that some of the non mainstream or old readers are unable to handle SVG.

Toxaris
02-26-2013, 05:47 AM
So far I haven't come across a reader that did not handle SVG in this manner.

mtrahan
02-26-2013, 08:06 AM
OK, good to know. Thank you all for your help—and specially davidfor for checking my file. Much appreciated.

I will use SVG for now—for this book at least, because for a reason the author of the book in question can't get the cover generated on his Kobo (with old firmware I suspect) otherwise...

JSWolf
02-26-2013, 09:51 AM
The disadvantage on using SVG in the cover.xhtml is that some of the non mainstream or old readers are unable to handle SVG.

Sony was the first ones to have ePub on an eInk reader using ADE. That old version of ADE does handle the SVG code just fine.