Ebook Covers

General comments and questions. Technical support.
Post Reply
rstroud
Posts: 251
Joined: Sun Mar 04, 2012 3:07 pm
Location: Tennessee
Contact:

Ebook Covers

Post by rstroud »

I know how difficult it can be to present a problem and make everything really clear. Sometimes I read what someone has posted here, I puzzle over it, and I finally give up.

So ... here goes with a possible problem. I do not know if it is truly a problem, but I think that it is worth discussing.

ISSUE: Atlantis-generated epub code for a book cover. Do we need the 'height' portion of the 'style' code?

When I attach a graphic for a book cover, in the usual way, here is the code for the book-cover page:

<body>
<p class="p0"><img alt="cover.jpg" src="../Images/cover.jpg" style="height:100%;max-width:100%" /></p>
</body>

My concern is this portion of the code:
style="height:100%;max-width:100%"

The resulting epub (with its cover) displays just fine in the Calibre viewer and in the Nook for PC viewer. The cover has proper proportions (at least, nothing is noticeably distorted). The graphic that I am using for the book cover is 631 x 1000 pixels (ratio 1:1.58), screen resolution 72 dpi. Here is an example of the well-known Shakespeare portrait. This is from Calibre, but Nook for PC represents it in a similar fashion:

Image

However, if I open the book in Sigil, the cover is distorted by severe elongation. (By the way, this has nothing to do with resizing the window; I have tried that.) From Sigil:

Image

Now, if I use Tweak (or Sigil) to change the book-cover style code to eliminate all reference to 'height', like this:

<body>
<p class="p0"><img src="images/cover.jpg" style="max-width:100%" alt="cover.jpg"/></p>
</body>

or if I change the 'height' code to 'max-height' like this:

style="max-height:100%;max-width:100%

the picture looks fine in Calibre, Nook for PC, and in Sigil. However, I do not know if it is good to have both dimensions (height and width) expressed in terms of a maximum. Maybe it does not matter. I have tried looking for answers on the internet, but all I find is that people have issues with distortion of book covers and do not seem to have any real understanding of what is going on with references to height. These are not Atlantis users, necessarily, just people who have found that book covers get distorted.

I think that maybe deleting all reference to 'height' is the best way to go. However, I would like to hear some other thoughts on this matter.

Does anyone know if an epub standard on this matter exists?

This may just be an issue with the Sigil epub viewer. I do not know about that. But maybe some other people here on the Atlantis board have observed these distortions in various readers. I am not concerned about what a book cover looks like in Sigil as long as the graphic displays properly in the various ebook readers.

Thanks!

Roland
Robert
Posts: 1906
Joined: Fri Aug 15, 2003 8:27 pm

Post by Robert »

Hi Roland,
As you have noticed, this is a rather vexed question. Some people claim to have found the Holy Grail of EPUB code for embedded pictures, but it is only because they have tested specific documents with specific pictures on specific eReaders.

Now, here is the low-down on this.

eReaders have screens with widely different sizes. Any given picture might display correctly within one screen, and get distorted in another. It all depends on the respective sizes of the pictures and the host screens. It also depends on the way the eReader software parses and interprets the EPUB code. So there is no solution that will fit all possible environments. But Atlantis outputs an EPUB code for pictures that will agree with most eReaders. And as you said yourself, what matters is how your eBooks display in the various eReaders, not in Calibre or Sigil. Try to test your eBooks in actual eReaders whenever possible. If your eBooks are meant to be displayed on specific eReaders, test them on these eReaders, not in Calibre or Sigil.

HTH.
Cheers,
Robert
Post Reply