Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > Workshop

Notices

Reply
 
Thread Tools Search this Thread
Old 10-30-2015, 10:21 AM   #1
poetrycoder
Junior Member
poetrycoder began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Oct 2015
Device: Kindle Fire
kindle bug with scaled images

Hi,

Has anyone else experienced this? I find that when I scale an image using ems, it works great on Kindle Fire (and on Kindle Previewer 3), except for one thing: If the user increases the font size so that the width of the image takes up the entire screen, it "locks" at that size, and subsequently the image no longer scales down with the font size; it simply takes up the entire width of the screen.

Before-and-after screenshots attached. This example is an in-line image used in kind of a weird way, but the same thing happens with all the images I've used in the book (a lot). Here's the CSS


img.under{
display:inline-block;
width:10em;
top:.7em;
right:10em;
}
span.under img.under{
vertical-align: baseline;
position: relative;
top: .7em;
}

<span class="under"><img class="under" src="images/underline.jpg" alt=""/>

Thanks!

—Chris
Attached Thumbnails
Click image for larger version

Name:	Screenshot 2015-10-30 10.05.27.png
Views:	293
Size:	20.2 KB
ID:	143294   Click image for larger version

Name:	Screenshot 2015-10-30 10.05.44.png
Views:	337
Size:	18.8 KB
ID:	143295  
poetrycoder is offline   Reply With Quote
Old 10-31-2015, 04:04 PM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,817
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Hmm

Is there a reason to NOT use text-decoration: underline?

Or another span cheat: border bottom: black solid 2pt; padding- bottom adjusts the spacing
theducks is offline   Reply With Quote
Advert
Old 11-06-2015, 09:17 AM   #3
poetrycoder
Junior Member
poetrycoder began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Oct 2015
Device: Kindle Fire
Thanks for the tip!

The short answer I'd like to keep the EPUB experience as close to the printed text as possible. I know that's a Quixotic effort but I got pretty close here.
poetrycoder is offline   Reply With Quote
Old 11-06-2015, 10:55 AM   #4
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,101
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
I'm not sure how widely supported background images are, but you could give a span the background image??

Code:
span.under {
    background-image: url("../Images/under.gif");
    background-repeat: no-repeat;
    background-position:center bottom
    }

<p>...in a rapturous frenzy, <span class="under">that she read to write.</span>
 So there is an irony there....</p>
You will want to make sure it's a .png or .gif with transparency, and you'll have to make sure the image is tall enough so that it vertically aligns properly.

You could also add css that would provide for those systems that don't render background images (eg text-decoration: underline), but someone else with more experience in that area would have to help with that.

Hope that helps!
Turtle91 is offline   Reply With Quote
Old 11-12-2015, 04:30 AM   #5
SBT
Fanatic
SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.
 
SBT's Avatar
 
Posts: 580
Karma: 810184
Join Date: Sep 2010
Location: Norway
Device: prs-t1, tablet, Nook Simple, assorted kindles, iPad
Just confirming that I've experienced the same bug. However, flipping a few pages forwards/backwards, and back again, seems to reset the size to the correct one.

As to the actual task in question, personally I'd go for a SVG solution – maybe even code the SVG straight into the document. And resign myself to using plain underline for the mobi fallback.
SBT is offline   Reply With Quote
Advert
Old 11-12-2015, 05:00 AM   #6
SBT
Fanatic
SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.
 
SBT's Avatar
 
Posts: 580
Karma: 810184
Join Date: Sep 2010
Location: Norway
Device: prs-t1, tablet, Nook Simple, assorted kindles, iPad
A MWE, only tested in a browser, would be interesting to know if it works in KF8:

Code:
<div>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor<svg xmlns="http://www.w3.org/2000/svg"
height="1em" width="4em"
style="inline;position:relative;left:-4.2em;top:1.1em;margin-right:-4.2em;" viewBox="77 480 330 100">
    <path
       d="m 77,498 c 130,-52 270,59 408,-30"
       style="stroke:#000000;fill:none;stroke-width:0.5em;" />
    </svg>  
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</div>
Attached Thumbnails
Click image for larger version

Name:	svgUnderline.png
Views:	460
Size:	4.1 KB
ID:	143646  
SBT is offline   Reply With Quote
Old 11-12-2015, 06:07 AM   #7
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by SBT View Post
A MWE, only tested in a browser, would be interesting to know if it works in KF8:
Unfortunately, it didn't work with the Kindle app and my PW2.
Doitsu is offline   Reply With Quote
Old 11-12-2015, 06:58 AM   #8
SBT
Fanatic
SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.
 
SBT's Avatar
 
Posts: 580
Karma: 810184
Join Date: Sep 2010
Location: Norway
Device: prs-t1, tablet, Nook Simple, assorted kindles, iPad
Quote:
Originally Posted by Doitsu View Post
Unfortunately, it didn't work with the Kindle app and my PW2.
@Doitsu: Thanks for checking it out.
Investigating it further, I did get the wavy line to show in the Previewer by wrapping the <svg> in a <span> and replacing em units with px inside the svg tag, but then ran up against a brick wall trying to get the inline SVG to scale with font size So it seems one has to store the line in an img file, but at least it should be OK to use SVG there.
SBT is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calibre window displays scaled holiveros Calibre 3 08-01-2013 12:28 PM
Kindle touch bug that causes bricking (kindle needs repair message) bdrosen Kindle Developer's Corner 2 01-24-2012 11:47 AM
Embedded font bug or CSS bug in ADE JSWolf ePub 10 06-11-2011 02:34 PM
A bug with images in epubs? Cyclops ePub 2 09-13-2010 10:57 AM
Scaled images in iBooks ckirchho Apple Devices 5 06-25-2010 05:21 AM


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


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