View Single Post
Old 08-01-2017, 01:07 PM   #33
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 11,503
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Quote:
Originally Posted by roger64 View Post
So at least both of us (not to forget slowsmile) do use percentages to tune our image display. I feel less alone as a portrait man.

There is a common sense way to deal with this:
- if there is an unique percentage width value required for one image, I think it's more handy to use an inline style because you get an immediate control over it. Furthermore, it works faithfully absolutely everywhere (@Hitch, please feel free to tell me if I am wrong).
As this thread seems to be commingling Sigil, ePUB and Amazon/Kindle, I will say this: your code will NOT work, not at all, for Amazon's KF7 devices, presuming that you're talking about what's in your first post. KF7 utterly ignores any CSS, inline or otherwise, and percentages are utterly worthless. (I honestly don't remember you using fixed pixel widths, and from your comment, above, presumably, you do not.)


Quote:
<snippage>

One last remark about "philosophy". I have rather trust my own calculations than rely on the haphazard understanding of various rendering engines in interpreting individual image sizes... I have had too many disappointments on this regard because if anything goes wrong -even a little-, you are unable to correct it easily (at simple view).
Quote:
Originally Posted by slowsmile View Post
@Hitch...It's funny that you asked me that question because I'm currently writing a Sigil plugin that will convert all absolute sizing and spacing values(e.g. pts, in, mms, cms, pc) in the epub stylesheet(s) to relative "em" values. So I guess you must be psychic...
Nah. However, William, ems aren't going to help you with KF7, either, and honestly, I've seen nearly as many issues with using ems for images as I have using any other measurement, and, in fact, more.

Quote:
...And the answer to your question is very similar. If we are talking epubs, Kindle, as well as other ereader vendors, don't like us using pixels(an absolute measure) for images smaller than 100% of the screen size. Kindle prefers smaller image dimensions as a value relative to current screen width -- in percentages. So if you don't use % values for your smaller images and use pixels instead then your smaller images will be screwed by the Kindle software as I've found with some Kindle conversions in the past. Lesson learned. Always use percentage values for your smaller ebook images for Kindle or it will be changed willy-nilly by the Kindle software viz the Kindle overrides. And as roger64 has said, using % values for smaller images will also work across all ereader types.
Well, firstly, again, "using % values for smaller images will also work across all ereader types" does not work for KF7.

Y'know, William, I have NEVER seen this. Not once have I seen the rendering engines screwing up our images that have % settings (as do all our images). Are you perchance discussing the LITB? Do you have a book where that's happened?

Granted, you can't rely on % settings/CSS altogether. You just can't. You have to create inline sizing, in hard pixels, for KF7, if you have an image that's smaller than 100% of the width of the screen. But that's that. Now, we do that for every single image--every one--that we do, that's smaller than 100%, b/c we have fallback for everything, for KF7, whether it's media queries for the CSS or this, for images. And I have never had a single complaint--in 3500 eBooks--with some client saying that her images were squooshed.

Quote:
In case you get me wrong, what I am inferring is this...If you, me and roger64 can easily calculate the value of a smaller image in pixels and convert this to a % value for Kindle then why can't the Kindle software team do this transformation and simple calculation for us when they display these smaller images on Kindles -- and do it accurately?
I must confess--since we've had our differences--I'm sort of sitting here, wondering if I should ruin your whole day or not. Letting you sit there and do all that work, only to find out that it's not going to work is a sort of Schadenfreude-potential thing, but....kiddo, Ixnay. You don't want to use ems.

Wanna make a wild guess as to why? Seriously?


Hitch
Hitch is offline   Reply With Quote