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

Go Back   MobileRead Forums > E-Book Formats > Kindle Formats

Notices

Reply
 
Thread Tools Search this Thread
Old 06-09-2016, 09:43 PM   #1
jcsalomon
Connoisseur
jcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheese
 
jcsalomon's Avatar
 
Posts: 90
Karma: 1000
Join Date: Jun 2012
Device: Bookari (née Mantano Reader) on Android; Kindle Fire HD
Question SVG wrapper image occupies entire page, and shouldn’t

Due to the lack of max-width support on Kindle platforms, I’ve been using the SVG wrapper to emulate its effect. Worked on ADE, and since all illustrations were at the end of chapters it looked like it was working on Kindle platforms.

The author’s just given me a pretty image rendering of the book title for use on the title page, and I tried using it thus:
Code:
  <div class="title">
    <h4 class="sigil_not_in_toc">Revised and Expanded</h4>

    <div class="img">
      <div class="mobi-fallback">
        <img alt="The Unexpected Enlightenment of Rachel Griffin, by L. Jagi Lamplighter" src="../Images/Enlightenment-01-Unexpected-title.png"/>
      </div>

      <div class="kf8-epub-default">
        <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="100%" viewBox="0 0 1128 789" preserveAspectRatio="xMidYMid meet"><image width="1128" height="789" xlink:href="../Images/Enlightenment-01-Unexpected-title.png"/></svg>
      </div>
    </div>

    <h2 class="sigil_not_in_toc">Based on the works of Mark A. Whipple</h2>

    <h3 class="sigil_not_in_toc">Illustrations by John C. Wright</h3>
  </div>
Trouble is, on KF8-capable Kindle devices, the image is not displayed on the same page as the rest of the text: there’s a page break before and after. Nothing in my CSS seems to call for such a page break, in fact the code for .title explicitly includes “page-break-inside: avoid;”. This renders correctly in ADE, BTW.

What am I missing?
Attached Files
File Type: epub Enlightenment-Problem.epub (543.1 KB, 202 views)
File Type: mobi Enlightenment-Problem.mobi (1.37 MB, 206 views)
jcsalomon is offline   Reply With Quote
Old 06-10-2016, 11:45 AM   #2
jcsalomon
Connoisseur
jcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheese
 
jcsalomon's Avatar
 
Posts: 90
Karma: 1000
Join Date: Jun 2012
Device: Bookari (née Mantano Reader) on Android; Kindle Fire HD
Following the examples given in “adding text after svg (not caption) on single page”, I’ve put the entire title page in an SVG block, with the old version wrapped in <div class="mobi-fallback">. So it’s not urgent, but I would still like to know why Kindles are breaking the page that way by default. Can anyone tell me?
jcsalomon is offline   Reply With Quote
Advert
Old 06-10-2016, 03:05 PM   #3
jhowell
Wizard
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 2,306
Karma: 24554558
Join Date: Nov 2011
Location: Florida
Device: Oasis 2, Fire, iPad Air 2, Nexus 7
I took a look at your document using Kindle Previewer 3 in Fire tablet mode. (This may not be perfect Kindle emulation, but can give an idea of what is going on.)

To diagnose the problem I changed a line in Title.xhtml from <div class="img"> to
<div class="img" style="border: 2px solid red">.

This allowed me to see that the SVG is being rendered as a rectangle that is significantly taller than it is wide even though the included PNG has a landscape orientation. This forces it to be on its own page.

Adding height="70%" to the SVG statement improved this by making the SVG render closer to a square. Still not correct, but allows the page to function better.

I have attached a screenshot of the page as displayed by the Previewer with the above changes made.


ETA: The presence of the SVG image prevented the Previewer from being able to render the book with Enhanced Typesetting. This could be a quirk of the Previewer or it might also occur when you actually publish the book.
Attached Thumbnails
Click image for larger version

Name:	screenshot.jpg
Views:	288
Size:	78.6 KB
ID:	149328  

Last edited by jhowell; 06-10-2016 at 03:37 PM.
jhowell is offline   Reply With Quote
Reply

Tags
image, image aspect ratio, image size, svg wrapper

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Calibre svg cover wrapper for full-page images roger64 Editor 8 02-05-2015 08:02 PM
Want to create border on image inside SVG wrapper GrannyGrump ePub 8 10-01-2014 09:41 PM
Svg wrapper and image resizing Nabodita ePub 24 05-02-2014 12:21 AM
Adding an SVG Wrapper ghostyjack Sigil 16 06-15-2013 05:13 AM
An Issue about a SVG wrapper RbnJrg Kindle Formats 29 06-10-2013 08:11 PM


All times are GMT -4. The time now is 06:01 AM.


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