MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Sigil (https://www.mobileread.com/forums/forumdisplay.php?f=203)
-   -   Cover image problems (https://www.mobileread.com/forums/showthread.php?t=335166)

Ashjuk 11-27-2020 05:37 AM

Cover image problems
 
1 Attachment(s)
I have a problem with the cover image displaying on some ebooks both in Sigil and on my Kobo.

I have a collection of books that have no cover image included so I have been downloading images from the Internet to add to them.

I have resized them all to 325 x 500 @ 72dpi. I created a cover page template file which I add to the books in question along with the corresponding image file.

My problem is that in some books the cover image appears perfectly in the preview pane and in some all I get is this -

And this is the cover page code -

Code:

<?xml version="1.0" encoding="utf-8"?>
<!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" xml:lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  <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; }
        </style>
</head>

<body>
  <div>
    <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="100%" height="100%" viewBox="0 0 460 706" preserveAspectRatio="none"><image width="460" height="706" xlink:href="cover.jpeg"/></svg>
  </div>
</body>
</html>

Any ideas where I am going wrong?

Doitsu 11-27-2020 06:40 AM

Most likely your cover image isn't found, because you didn't include a path in the xlink:href value.

Code:

xlink:href="cover.jpeg"
However, unless you didn't create the book with Sigil, it should have the following path, if your book has an Images folder and you added the cover image to it:

Code:

xlink:href="../Images/cover.jpeg"
You might want to install the FlightCrew and EpubCheck plugins and check your book with it.

You also might want to right-click the cover image file in the Book Browser and make sure that there's a check mark before the Cover Image entry.

Ashjuk 11-27-2020 09:01 AM

Quote:

Originally Posted by Doitsu (Post 4062602)
Most likely your cover image isn't found, because you didn't include a path in the xlink:href value.

I have now included the path and the image still does not display.

Quote:

Originally Posted by Doitsu (Post 4062602)
You might want to install the FlightCrew and EpubCheck plugins and check your book with it.

Thanks, I will check them out.

Quote:

Originally Posted by Doitsu (Post 4062602)
You also might want to right-click the cover image file in the Book Browser and make sure that there's a check mark before the Cover Image entry.

The image has a check mark against cover image, so not that.

KevinH 11-27-2020 09:12 AM

That happens for one of three reasons:

1. the image file can not be found

2. the image file was never added properly to the epub by Sigil so you have an href pointing outside the book itself.

3. the image file format does not match the ext/mimetype or is unreadable

Doitsu 11-27-2020 09:14 AM

Quote:

Originally Posted by Ashjuk (Post 4062639)
I have now included the path and the image still does not display.

Then the book most likely doesn't contain an Images folder and/or cover.jpeg isn't in that folder.
Please post a screenshot of the Book Browser window that shows the location of cover.jpeg.

Ashjuk 11-27-2020 09:27 AM

1 Attachment(s)
Quote:

Originally Posted by Doitsu (Post 4062643)
Then the book most likely doesn't contain an Images folder and/or cover.jpeg isn't in that folder.
Please post a screenshot of the Book Browser window that shows the location of cover.jpeg.

Book definitely has an Images folder and the file cover.jpg is there.

I have installed FlightCrew and ePubCheck. FlightCrew has no warnings regarding the cover image and ePubCheck failed to run for some reason.

Still baffled.

Doitsu 11-27-2020 09:34 AM

The name of your cover image is cover.jpg, however, the cover image xlink:href attribute references cover.jpeg.

It should work, if you change the path to:

Code:

xlink:href="../Images/cover.jpg"
If that still doesn't work, delete the cover HTML file and create a new one via Tools > Add cover...

Ashjuk 11-27-2020 09:41 AM

Quote:

Originally Posted by Doitsu (Post 4062651)
The name of your cover image is cover.jpg, however, the cover image xlink:href attribute references cover.jpeg.

It should work, if you change the path to:

Code:

xlink:href="../Images/cover.jpg"
If that still doesn't work, delete the cover HTML file and create a new one via Tools > Add cover...

Thanks, I deleted the cover image and used the Add Cover as you suggested and it now displays correctly.

I had previously tried editing the path to include ../Images but that did not work so I changed it back again.

If I come across this problem again I now know what to do, thanks again for your help.

DiapDealer 11-27-2020 10:07 AM

For future reference: please note that the folders shown in the Book Browser are only a virtual representation of file-types contained in the epub archive (starting with Sigil 1.0). The fact that an 'Images' folder appears there does not, in fact, mean that there's an 'Images' folder present in the epub's archive. There could be one, but the fact that cover.jpg appears under the virtual 'Images' folder only means that Sigil knows that cover.jpg is an image.

The tooltip, when hovering over a file, shows the actual file path within an epub's archive. You can also set the full path of all files to always show in Book Browser in Sigil's preferences. Doing so can help to reinforce the idea that Book Browser is a representation of an epub's various file-types and is not necessarily indicative of its internal folder structure.

KevinH 11-27-2020 10:43 AM

Yes when hand creating any links, you must know the true path to the file that is the link starting point and the true path to the destination file (the link's ending point).

So either mousing over both to see their path or turning on full paths in Sigil Preferences will do that for you.

But why not let Sigil handle all of that by using the Add Cover, Insert Image, Insert Link, Insert Style tools to automate that process for you.

Ashjuk 11-27-2020 12:57 PM

Quote:

Originally Posted by DiapDealer (Post 4062659)
For future reference: please note that the folders shown in the Book Browser are only a virtual representation of file-types contained in the epub archive (starting with Sigil 1.0). The fact that an 'Images' folder appears there does not, in fact, mean that there's an 'Images' folder present in the epub's archive. There could be one, but the fact that cover.jpg appears under the virtual 'Images' folder only means that Sigil knows that cover.jpg is an image.

The tooltip, when hovering over a file, shows the actual file path within an epub's archive. You can also set the full path of all files to always show in Book Browser in Sigil's preferences. Doing so can help to reinforce the idea that Book Browser is a representation of an epub's various file-types and is not necessarily indicative of its internal folder structure.

Thanks for the information - I'm still learning my way with Sigil so things like this will stump me. What was confusing me was that it appeared to work fine with one book and not another and I couldn't work out why that should be so.

Quote:

Originally Posted by KevinH (Post 4062671)
Yes when hand creating any links, you must know the true path to the file that is the link starting point and the true path to the destination file (the link's ending point).

So either mousing over both to see their path or turning on full paths in Sigil Preferences will do that for you.

But why not let Sigil handle all of that by using the Add Cover, Insert Image, Insert Link, Insert Style tools to automate that process for you.

Yes, in future I will just use the Add Cover option to create the cover page. I had not spotted that in the menu - still discovering things.

Thanks for everyone's help.

DNSB 11-27-2020 02:48 PM

2 Attachment(s)
Quote:

Originally Posted by Ashjuk (Post 4062725)
Thanks for the information - I'm still learning my way with Sigil so things like this will stump me. What was confusing me was that it appeared to work fine with one book and not another and I couldn't work out why that should be so.

One item that might help is in the Preferences => Appearance => Main UI, select "BookBrowser should show full paths". This will show the full path which I find useful when opening an epub that I did not generate where you can find files stuffed into random directories or no directories.

BetterRed 11-27-2020 06:58 PM

Quote:

Originally Posted by DNSB (Post 4062758)
One item that might help is in the Preferences => Appearance => Main UI, select "BookBrowser should show full paths". This will show the full path which I find useful when opening an epub that I did not generate where you can find files stuffed into random directories or no directories.

:thumbsup:

Be good to have a keyboard shortcut to toggle that setting.

BR

KevinH 11-27-2020 08:05 PM

It is not something that needs to be toggled often or all all. It is more a personal preference since all information is easily available in either mode and the Sigil tools already exist to prevent the need to hand edit links at all, which can be error prone.

Ashjuk 11-28-2020 04:45 AM

Quote:

Originally Posted by DNSB (Post 4062758)
One item that might help is in the Preferences => Appearance => Main UI, select "BookBrowser should show full paths". This will show the full path which I find useful when opening an epub that I did not generate where you can find files stuffed into random directories or no directories.

Thanks. I have done now done that following Kevin's advice earlier.


All times are GMT -4. The time now is 10:34 PM.

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.