12-10-2013, 06:41 PM | #1 |
Member
Posts: 17
Karma: 10
Join Date: Dec 2013
Device: none
|
epub images are broken in Kobo
Hey all,
I have a project that was exported from InDesign to epub2.0.1. On iPad looks nice, but Kobo breaks images e.g. one page has the top part of the image, the next page has the rest. I tried to give "page-break-inside:avoid" to the images in the CSS file, since the "page-break-before" property worked, but unfortunately it's still the same. Every img tag is inside a div. I would appreciate any idea how I can make it work. Last edited by Liliann; 12-10-2013 at 06:43 PM. |
12-10-2013, 07:24 PM | #2 |
Fanatic
Posts: 580
Karma: 810184
Join Date: Sep 2010
Location: Norway
Device: prs-t1, tablet, Nook Simple, assorted kindles, iPad
|
Some sample code with images would be helpful, if possible.
|
Advert | |
|
12-11-2013, 06:47 AM | #3 |
Color me gone
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
|
You can run into this sort of a problem if you have included text inside of your div or paragraph along with the image making the combination of text and image too big for one page.
There is no easy solution if you want both text and image to display on the same page, since the user can increase the text size and cause it to fail. You can shrink the image slightly and add the caption as part of the image at the bottom. |
12-11-2013, 03:31 PM | #4 |
Member
Posts: 17
Karma: 10
Join Date: Dec 2013
Device: none
|
Here is a sample of the code:
<div class="frame-2"> <img class="frame-30" src="image/1647_002_fmt.jpg" alt="flame" /> </div> All of them is written in the same way. There is no paragraph just the image. And I made a picture of the two pages to show how it looks like. I hope you can see it. |
12-11-2013, 03:47 PM | #5 |
Color me gone
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
|
What is the frame-2 class and the frame-30 class?
What is the size of the image in pixels? |
Advert | |
|
12-11-2013, 03:49 PM | #6 | |
Wizard
Posts: 1,542
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
Would it be possible for you to post also the definitions of the classes "frame-2" and "frame-30"? You'll find them in your css stylesheet. |
|
12-11-2013, 04:11 PM | #7 |
Fanatic
Posts: 580
Karma: 810184
Join Date: Sep 2010
Location: Norway
Device: prs-t1, tablet, Nook Simple, assorted kindles, iPad
|
The majority of e-ink e-readers have screen ratios width:height of 3/4. If your image has a width:height ratio less than this, it'll be split over pages. One remedy is to pad your image with white left- and right margins, another is to define such margins in the style sheet. There is sadly no method within the Epub2 specifications to allow the reader to fit the screen vertically.
So what's the width and height of the image in question, Liliann? |
12-11-2013, 06:19 PM | #8 |
Member
Posts: 17
Karma: 10
Join Date: Dec 2013
Device: none
|
Thanks for the answers.
Every div with an image inside has the frame-2 class with the following style: div.frame-2 { margin: 0px auto 0px auto; text-align: center; } And every image has different height and width. The one I've sent has these properties: img.frame-30 { height: 756px; width:553px; } These classes and properties are generated by inDesign. The problem is that they made the project originally for different reasons not to create an epub. I'm trying to keep the design as much as I can, but I see that epub doesn't support everything I'd like to. I was thinking to give a max-width to the div-s but I don't know how much or it works at all... |
12-11-2013, 07:08 PM | #9 | |
Wizard
Posts: 1,542
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
Code:
div.frame-2 {
margin: 0px auto 0px auto;
text-align: center;
page-break-inside: avoid;
}
Code:
img.frame-30 { height: auto; width: 100%; } Regards Rubén |
|
12-11-2013, 07:22 PM | #10 |
Color me gone
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
|
Which dimension is which? If it is 756 px wide, it is too wide for a small screen, which is about 600. That could be a problem if that is the case. There are ways of handling it suggested by Ruben, but just by itself that would be too wide. A little under 800 px high is all you can go without having problems in some units without adding some extra information to the image statement.
|
12-12-2013, 01:54 AM | #11 |
Fanatic
Posts: 580
Karma: 810184
Join Date: Sep 2010
Location: Norway
Device: prs-t1, tablet, Nook Simple, assorted kindles, iPad
|
The width:height ratio of your image is 0.73, so Rubens suggestion probably will not give the desired result. I would suggest adding margins in the stylesheet, something like:
Code:
img.frame-30 { width:90%; margin:auto 5%; } |
12-12-2013, 05:28 AM | #12 |
Member
Posts: 17
Karma: 10
Join Date: Dec 2013
Device: none
|
The original image size of this one:
width: 1153px; height: 1577px; I'll try your solutions and get back with the result. |
12-12-2013, 03:27 PM | #13 |
Member
Posts: 17
Karma: 10
Join Date: Dec 2013
Device: none
|
Unfortunately they didn't work. When the image was fine in portrait mode, it was still broken in landscape, and with the other solution it wasn't broken but distorted. I keep trying because it partly worked at least.
I really appreciate your replies, good to see an active forum with helpful people. |
12-12-2013, 04:59 PM | #14 | |
Wizard
Posts: 1,542
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
Code:
img.frame-30 { height: 100%; width: auto; } Regards Rubén |
|
12-12-2013, 05:30 PM | #15 | |
Fanatic
Posts: 580
Karma: 810184
Join Date: Sep 2010
Location: Norway
Device: prs-t1, tablet, Nook Simple, assorted kindles, iPad
|
Quote:
I'm very much afraid you can't have it both ways (if you'll pardon the pun) |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
PNG Images in ePUB Files not rendered on Kobo | DragonflyKing | ePub | 12 | 10-12-2013 08:28 PM |
Images are broken across 2 pages after converting to ePub from RTF. iPhone. | vital2k | Conversion | 2 | 05-31-2011 01:46 AM |
No images in kobo epub books? | jayupark | Kobo Reader | 8 | 03-29-2011 04:06 PM |
Multi-level TOC broken in epub->epub conversion | siebert | Conversion | 14 | 03-09-2011 05:38 PM |