Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 07-24-2012, 07:23 AM   #1
Mrs_Often
Wizard
Mrs_Often ought to be getting tired of karma fortunes by now.Mrs_Often ought to be getting tired of karma fortunes by now.Mrs_Often ought to be getting tired of karma fortunes by now.Mrs_Often ought to be getting tired of karma fortunes by now.Mrs_Often ought to be getting tired of karma fortunes by now.Mrs_Often ought to be getting tired of karma fortunes by now.Mrs_Often ought to be getting tired of karma fortunes by now.Mrs_Often ought to be getting tired of karma fortunes by now.Mrs_Often ought to be getting tired of karma fortunes by now.Mrs_Often ought to be getting tired of karma fortunes by now.Mrs_Often ought to be getting tired of karma fortunes by now.
 
Mrs_Often's Avatar
 
Posts: 1,775
Karma: 2694823
Join Date: Dec 2011
Location: The Netherlands
Device: Kobo Touch, Glo, Clara HD
Custom code in ePub titlepage.xhtml

Does anyone know if there's a way to have Calibre put different size values in the titlepage for the cover, when converting to ePub?

I have a Kobo Touch which listens to the values in the titlepage.xhtml when displaying the cover... unfortunately Calibre puts the following in the body:

Code:
<image height="684" width="512" xlink:href="../Images/cover.jpeg"></image>
Since the Kobo Touch screen is 800 x 600 pixels, the above always causes my covers to have right and left margins (it doesn't fill the screen). Even if the actual jpg has the right dimension, this code still messes it up. It drives me crazy. The only way to fix it that I've found so far is to physically go and change the code in the titlepage.xhtml for each and every epub. Very time consuming.

So I'd like to tell Calibre to put either no size in at all, or 800 x 600, when converting to ePub. That way I can correct the cover sizes of all my ePubs in one go. Any genius ideas on how to do this?
Mrs_Often is offline   Reply With Quote
Old 07-24-2012, 09:44 AM   #2
mbovenka
Wizard
mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.
 
Posts: 2,018
Karma: 13471689
Join Date: Oct 2007
Location: Almere, The Netherlands
Device: Kobo Sage
Quote:
Originally Posted by Tasmin View Post
So I'd like to tell Calibre to put either no size in at all, or 800 x 600, when converting to ePub. That way I can correct the cover sizes of all my ePubs in one go. Any genius ideas on how to do this?
Try using the 'Tablet' output profile (Preferences -> Conversion -> Common Options -> Page Setup). That doesn't do any image resizing; maybe that will get rid of the size declaration.

Haven't tried it, though.
mbovenka is online now   Reply With Quote
Advert
Old 07-24-2012, 10:05 AM   #3
gbm
Wizard
gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.
 
Posts: 2,082
Karma: 8796704
Join Date: Jun 2010
Device: Kobo Clara HD,Hisence Sero 7 Pro RIP, Nook STR, jetbook lite
Try under covert--epub output checking Preserve cover aspect ratio.

bernie
gbm is offline   Reply With Quote
Old 07-24-2012, 11:10 AM   #4
Mrs_Often
Wizard
Mrs_Often ought to be getting tired of karma fortunes by now.Mrs_Often ought to be getting tired of karma fortunes by now.Mrs_Often ought to be getting tired of karma fortunes by now.Mrs_Often ought to be getting tired of karma fortunes by now.Mrs_Often ought to be getting tired of karma fortunes by now.Mrs_Often ought to be getting tired of karma fortunes by now.Mrs_Often ought to be getting tired of karma fortunes by now.Mrs_Often ought to be getting tired of karma fortunes by now.Mrs_Often ought to be getting tired of karma fortunes by now.Mrs_Often ought to be getting tired of karma fortunes by now.Mrs_Often ought to be getting tired of karma fortunes by now.
 
Mrs_Often's Avatar
 
Posts: 1,775
Karma: 2694823
Join Date: Dec 2011
Location: The Netherlands
Device: Kobo Touch, Glo, Clara HD
Quote:
Originally Posted by mbovenka View Post
Try using the 'Tablet' output profile (Preferences -> Conversion -> Common Options -> Page Setup). That doesn't do any image resizing; maybe that will get rid of the size declaration.

Haven't tried it, though.
Yay! It worked! I'm so happy! Thank you mbovenka.

Very weird that the Kobo reader's profile is set to put wrong dimensions in...

EDIT: Except that it doesn't work, see my next post.

Quote:
Originally Posted by gbm View Post
Try under covert--epub output checking Preserve cover aspect ratio.

bernie
Thanks bernie, I tried that before. What it does is indeed preserve the aspect ratio, but not the exact number of pixels. So for instance, it will set the size to 512x648... And my Kobo makes the image that size, leaving the left over pixels blank.

Last edited by Mrs_Often; 07-24-2012 at 11:22 AM.
Mrs_Often is offline   Reply With Quote
Old 07-24-2012, 11:25 AM   #5
Mrs_Often
Wizard
Mrs_Often ought to be getting tired of karma fortunes by now.Mrs_Often ought to be getting tired of karma fortunes by now.Mrs_Often ought to be getting tired of karma fortunes by now.Mrs_Often ought to be getting tired of karma fortunes by now.Mrs_Often ought to be getting tired of karma fortunes by now.Mrs_Often ought to be getting tired of karma fortunes by now.Mrs_Often ought to be getting tired of karma fortunes by now.Mrs_Often ought to be getting tired of karma fortunes by now.Mrs_Often ought to be getting tired of karma fortunes by now.Mrs_Often ought to be getting tired of karma fortunes by now.Mrs_Often ought to be getting tired of karma fortunes by now.
 
Mrs_Often's Avatar
 
Posts: 1,775
Karma: 2694823
Join Date: Dec 2011
Location: The Netherlands
Device: Kobo Touch, Glo, Clara HD
I spoke too soon, it doesn't work. But I really don't understand why not. The code Calibre puts in the titlepage.xhtml is:

Code:
<?xml version='1.0' encoding='utf-8'?>
<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 600 800" preserveAspectRatio="none">
                <image width="600" height="800" xlink:href="cover1.jpeg"/>
            </svg>
        </div>
    </body>
</html>
That still makes left and right margins when viewing the cover in the Kobo.

If I completely remove the size tags from that code, the cover is even worse: left margin smaller than right margin, and top and bottom margins too!

The following code does work, but I have to put that in manually. I really can't see anything in the above code that would mess the cover up...

Code:
<?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></title>
  <style type="text/css">
/*<![CDATA[*/

  body.sgc-1 {margin: 0px; text-align: center;}
  /*]]>*/
  </style>
</head>

<body class="sgc-1">
  <div><img alt="" src="cover1.jpeg" /></div>
</body>
</html>

Last edited by Mrs_Often; 07-24-2012 at 11:28 AM.
Mrs_Often is offline   Reply With Quote
Advert
Old 07-24-2012, 12:04 PM   #6
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,975
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
The way it's supposed to work is that titlepage.xhtml has the values for the dimensions for the cover image. Then if you care about how it looks, you have the aspect ratio correct. So the cover image will fill the screen top to bottom, but usually not left to right as that would make the cover image stretched and look off. So the best thing is to check that you want the aspect ratio preserved and you want to use the correct profile as a tablet profile can mess things up when the image is larger then your screen.
JSWolf is offline   Reply With Quote
Old 07-24-2012, 12:36 PM   #7
Mrs_Often
Wizard
Mrs_Often ought to be getting tired of karma fortunes by now.Mrs_Often ought to be getting tired of karma fortunes by now.Mrs_Often ought to be getting tired of karma fortunes by now.Mrs_Often ought to be getting tired of karma fortunes by now.Mrs_Often ought to be getting tired of karma fortunes by now.Mrs_Often ought to be getting tired of karma fortunes by now.Mrs_Often ought to be getting tired of karma fortunes by now.Mrs_Often ought to be getting tired of karma fortunes by now.Mrs_Often ought to be getting tired of karma fortunes by now.Mrs_Often ought to be getting tired of karma fortunes by now.Mrs_Often ought to be getting tired of karma fortunes by now.
 
Mrs_Often's Avatar
 
Posts: 1,775
Karma: 2694823
Join Date: Dec 2011
Location: The Netherlands
Device: Kobo Touch, Glo, Clara HD
I'm not quite sure I understand what you mean JSWolf... The correct profile has never worked for me (cover always too small and aspect ratio different to the screen). The actual size of the image itself I've made sure is 600x800 pixels...
Mrs_Often is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Code which creates recipe feed xhtml? mattst Development 4 11-02-2011 01:33 PM
Find Dialog and XHTML Code View jondolar Sigil 0 10-18-2011 10:16 AM
Graphical layout vs. semantically "correct" XHTML code Iznogood Workshop 16 04-05-2011 08:14 AM
PRS700 just shows Titlepage in EPUB cremofix Calibre 4 10-30-2009 01:17 PM
xhtml from epub georger ePub 8 10-13-2009 07:14 AM


All times are GMT -4. The time now is 09:10 AM.


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