Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 07-24-2012, 08: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,310
Karma: 1495609
Join Date: Dec 2011
Location: The Netherlands
Device: Kobo Touch, Kobo Glo
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, 10: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: 1,250
Karma: 1619751
Join Date: Oct 2007
Location: Almere, The Netherlands
Device: Kobo Aura H2O
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 offline   Reply With Quote
 
Advertisement
Old 07-24-2012, 11:05 AM   #3
gbm
Guru
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: 713
Karma: 1332996
Join Date: Jun 2010
Device: Hisence Sero 7 Pro, 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, 12:10 PM   #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,310
Karma: 1495609
Join Date: Dec 2011
Location: The Netherlands
Device: Kobo Touch, Kobo Glo
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 12:22 PM.
Mrs_Often is offline   Reply With Quote
Old 07-24-2012, 12:25 PM   #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,310
Karma: 1495609
Join Date: Dec 2011
Location: The Netherlands
Device: Kobo Touch, Kobo Glo
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 12:28 PM.
Mrs_Often is offline   Reply With Quote
Old 07-24-2012, 01: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: 37,793
Karma: 18701452
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Sony Reader PRS-650, iPad, nook STR
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 online now   Reply With Quote
Old 07-24-2012, 01: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,310
Karma: 1495609
Join Date: Dec 2011
Location: The Netherlands
Device: Kobo Touch, Kobo Glo
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

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

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


All times are GMT -4. The time now is 09:33 PM.


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