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 01-17-2013, 05:57 PM   #1
Cristofer
Junior Member
Cristofer began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jan 2013
Device: none
Calibre cbr/cbz to epub conversion help needed!

Hello,

I am trying to convert some Cbz or Cbr comics into Epub with Calibre and I am facing one problem: with the converted Epub the comic pages (= pictures) do not show up in full scale on the e-readers, even though the resolution of my comic pictures are very big (1536 pixels by 2048 pixels). I would like the pages/images to always show up in the original image resolution (in this case 1536 pixels by 2048 pixels) independently of the e-readers screen resolution. Only like this it is possible to effectively read the texts in the images. With smaller screen resolution e-readers the pages (images) should also show up in their full resolution so that the reader will need to scroll to see the whole page. Very important is also that the pages should not "split" or "break" into several pages.

I have the feeling that many comic lovers dislike the whole idea of epub but I really would like to try to produce an acceptable epub version of comics since it is the only way to be able to distribute them on Amazon and iTunes for example. Please see one attached public domain comic as example the epub result. I tried to also upload the cbz file but it seems this forum doesn't accept uploading cbz files? Anyway it is only 12 pictures in the size of 1536 pixels by 2048 pixels. I have also uploaded a detailed PDF showing the settings I used with Calibre.

I have researched the internet for finding solutions to the 2 problems: not to split images into several pages ("nobreak") and how to display the pictures in their original resolution, but haven't found any convincing solution. I hope this could be possible to do with Calibre, since it is an excellent program and maybe I just don't know how to determine the right settings? The conversion is otherwise great and creates a TOC with all the pages numbered.

If it is not possible to resolve this problem with Calibre settings then I would very much appreciate if somebody has an alternative solution to how I could modify the code in Sigil in order to make the pages (pictures) show up in their original size always (even if the e-readers screen resolution is smaller than the picture resolution) and not split or break into several pages.

For the "nobreak" of pictures I have found one indication online:

to include in the CSS stylesheet:

.nobreak {
page-break-inside: avoid;
}

AND to embed each page/picture with the code:

<body class="calibre">
<div class="nobreak"><img alt="comic page #8" class="calibre2" src="../Images/7_0.jpg" /></div>
</body>


For the problem of how to make pictures show up in their original resolution independently of the e-readers screen resolution I found the following indication for SVG encapsulating but I am not sure how to apply it and if it will be accepted by all e-readers and stores:

From: http://denis.papathanasiou.org/?p=592

Quoted:

For some types of books (such as manga, comics, or graphic novels),
epub doesn’t seem to be able to handle large images that should fill
the screen.

Apple has gone so far as to create its own fixed layout format for such ebooks.

It is possible, though, to stick with epub and get perfect results for
illustrated ebooks, using the forgotten (or perhaps simply overlooked)
svg image element.

Here’s a peek under the hood of how we do it at eBookBurn.com, as part
of our new illustrated ebook publishing feature.

This is an example of the markup to use in your epub’s xhtml files for
each image:

<svg version="1.1" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" width="100%" height="100%"
viewBox="0 0 1536 2048" preserveAspectRatio="xMidYMid meet">
<image width="1536" height="2048" xlink:href="images/page01.jpeg" />
</svg>

What this markup does is take a JPEG image sized 1536 pixels wide by
2048 pixels tall, and frame it in the center of a 1536×2048 svg
element.

So why use svg at all?

Wouldn’t it be simpler to define it with the plain img tag (as this
epub template does), like this?

<img src="images/page01.jpeg" width="592" height="900" alt="Page 1"/>

Many devices, such as the iPad and the Nook Color, have screens larger
than six inches: so on those devices, using the plain img tag in your
epub’s xhtml files leaves an embarrassing whitespace gap, from where
the image stops to where the actual screen ends.

The svg element shown earlier, though, is different: it stretches the
image to fill the entire screen, while preserving the aspect ratio.

It’s also important to note that width and height specified within the
svg and image elements should not be thought of as pixel sizes, since
no units are defined, but as a width-to-height ratio.

For most devices, that’s enough, but some e-readers insist on adding
margins and other padding to each page, so it’s helpful to define this
in the xhtml file’s head block:

<style type="text/css">
@page { margin: 0.000000pt; padding: 0.000000pt; }
</style>

And these css classes in the stylesheet:

.svg_outer {
display: block;
margin-bottom: 0;
margin-left: 0;
margin-right: 0;
margin-top: 0;
padding-bottom: 0;
padding-left: 0;
padding-right: 0;
padding-top: 0;
text-align: left;
}
.svg_inner {
display: block;
text-align: center;
}

So the final xhtml for each page image looks like this:


<div class="svg_outer">
<div class="svg_inner">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" width="100%" height="100%"
viewBox="0 0 592 900" preserveAspectRatio="xMidYMid meet">
<image width="1536" height="2048" xlink:href="images/0_0.jpg"></image>
</svg>
</div>
</div>
</body>

Just repeat that pattern for every image in book, for every chapter
that contains full-page illustrations.


Thanks very much in case you did read until here :-)

All comments and indications are very much appreciated!

Cristofer
Attached Files
File Type: epub Nemo1905OctDec - Unknown_new.epub (8.16 MB, 55 views)
File Type: pdf MyCalibreConversionSettings.pdf (724.9 KB, 121 views)
Cristofer is offline   Reply With Quote
Old 01-17-2013, 10:37 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 24,820
Karma: 4369673
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You cannot in general do this. Most epub reading software automatically resizes images to fit on the screen. Note that many readers accept cbz format files and for others you can convert the cbz to pdf.
kovidgoyal is offline   Reply With Quote
Old 01-18-2013, 06:27 AM   #3
Cristofer
Junior Member
Cristofer began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jan 2013
Device: none
How to make sure the picture fills the screen and what about SVG encapsulation?

Thank you very much for taking time to reply Kovid, could you just please consider the following issues that I have:

1) the problem with the attached example is that the pictures do NOT fill the screen automatically (when tested on iPad3 it leaves big white margins and the picture shows up quite small). Is there any setting / code that I could use in order to be sure that the picture fills up the whole screen at least?

2) Is the SVG encapsulation idea not a good one or worth exploring?:

http://denis.papathanasiou.org/?p=592

<svg version="1.1" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" width="100%" height="100%"
viewBox="0 0 1536 2048" preserveAspectRatio="xMidYMid meet">
<image width="1536" height="2048" xlink:href="images/page01.jpeg" />
</svg>


PS. I am a newcomer / dummy in epub, trying to learn by experimenting so please forgive me if I'm asking "stupid" questions!

All the best, Cristofer
Cristofer is offline   Reply With Quote
Old 01-25-2013, 05:40 PM   #4
CGiha
Junior Member
CGiha began at the beginning.
 
CGiha's Avatar
 
Posts: 1
Karma: 10
Join Date: Jan 2013
Device: iPad 3
MOBI too?

Quote:
Originally Posted by kovidgoyal View Post
You cannot in general do this. Most epub reading software automatically resizes images to fit on the screen. Note that many readers accept cbz format files and for others you can convert the cbz to pdf.
Would this apply to MOBI as well? I came here trying to solve the exact same behavior when converting CBZ to MOBI.

Just trying to get all my kid's stuff into a single app (Kindle) instead of two or three.

Thanks much!

C.
CGiha is offline   Reply With Quote
Old 01-25-2013, 09:53 PM   #5
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 24,820
Karma: 4369673
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
yes, it would.
kovidgoyal 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
massive CBR to CBZ conversion of books in calibre database whitespirit Conversion 11 11-23-2012 09:30 AM
Conversion of comics (CBR/CBZ) FangornUK Conversion 269 09-05-2012 11:43 PM
How to remove White margin in CBR/CBZ ->mobi conversion for Kindle using Calibre? jokermania Amazon Kindle 4 07-01-2011 05:12 PM
Cbr\Cbz to Mobi Conversion Problem arktoga Calibre 0 07-22-2010 08:37 AM
Having a problem with CBR/CBZ conversion curtw Calibre 5 10-03-2008 03:11 AM


All times are GMT -4. The time now is 05:55 AM.


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