![]() |
#31 | ||
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,339
Karma: 20171571
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Quote:
Did you READ Diap's message?? Quote:
|
||
![]() |
![]() |
![]() |
#32 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 427
Karma: 65460
Join Date: Jun 2011
Device: Kindle
|
So... I used the the html/body 100% approach, and there were a couple idiosyncracies...
Code:
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <style type="text/css"> html, body { height: 100%; margin: 0; padding: 0; } p.imagefull { display: block; height:100%; text-align: center; margin: 0; padding: 0; } .imgfull { height: 100%; width: auto; } </style> </head> <body> <p class="imagefull"><img src="../Images/00.jpg" class="imgfull"/></p> </body> </html> In Calibre, narrowing the window beyond the image's natural dimensions doesn't resize the image, but rather smooshes it (see fullpageimg2.jpg). Otherwise, it seems to work like Sigil/PageEdit Now, bearing in mind that the perhaps an svg wrapper would work differently, I'm still curious why THIS didn't work. Is there something funky in my styling? Or something missing? And why do Sigil and Calibre render this differently? [NOTE: attached images are with the height for "imgfull" set to 99%, not 100%] |
![]() |
![]() |
Advert | |
|
![]() |
#33 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,711
Karma: 8700123
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
![]() Last edited by RbnJrg; 06-14-2025 at 11:41 AM. |
|
![]() |
![]() |
![]() |
#34 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 427
Karma: 65460
Join Date: Jun 2011
Device: Kindle
|
@RbnJrg - I assume you're referring to this post?
If so, I had read it (and just reviewed the attached test files), but it's a bit different from what I'm talking about. Specifically, in your example you are setting image height and width to 100%, whereas I'm setting the width to "auto". If you were referring to your first post, where you mentioned that using "width: auto" could make the width larger than 100%, I'm still confused as to why. Isn't auto supposed mean that it will use available space? Is it that the 100% height has priority over the "auto" width? If so, why? Does height always have priority over width, or is the value-defined setting always prioritize over a competing "auto" setting (regardless of which is defining height and which is definining width)? Moreover, as I said in my previous post, part of what's confusing me is that it renders differently between Sigil/PageEdit and Calibre. The distortion you describe in your recent example (again, because the code is slightly different) isn't really what I'm referring to (or at least, I don't think it is...). In my example, Sigil/PageEdit doesn't distort the image at all, it just refuses to resize if the window gets too narrow (which i think may be what you were referring to in your first post). Whereas in Calibre it doesn't stretch or scroll, but it will compress when the window gets too narrow. Separately, the issue of 100% height rendering as slightly more than 100% of the window height (resulting in a vertical scrollbar) is a little different than the commentary you've made regarding this setting (and its 99/97/95vh corollary). You seemed to be cautioning against these maximized height settings resulting in the insertion of blank space/pages. My issue is not with any blank space insertion (I didn't see any in either Sigil/PageEdit or Calibre), but rather that the 100% height renders as taller than 100% of the window/container height. Last edited by ElMiko; 06-14-2025 at 12:23 PM. |
![]() |
![]() |
![]() |
#35 | ||||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,711
Karma: 8700123
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
Quote:
Code:
body { margin: 0; } .myFullHeight { height: 100%; } @supports(height:99vh) { .myFullHeight { height: 99vh; } } Code:
.myDiv { height: 100%; width: auto; } Code:
.myDiv { height: 100%; } Quote:
Quote:
https://www.mobileread.com/forums/sh...39&postcount=7 Of course, in all what I wrote above, I was assuming you're working for a full-page image, with no text before or after it on the same page (otherwise you wouldn't have used html, body {height: 100%}). If there is text before or after the image (on the same page) then you have to use the following code: 1. In your .css stylesheet: Code:
.myFullHeight { /* This is for RMSDK rendering engines */ height: 99%; } @supports(height:98vh) { /* This is for Readium/Webkit rendering engines */ .myFullHeight { height: 98vh; /* Here you also could try with 95vh */ } } Code:
<p>blah, blah, blah,...any extension of text</p> <div class="myFullHeight"> <svg xmlns="http://www.w3.org/2000/svg" height="100%" preserveAspectRatio="xMidYMid meet" version="1.1" viewBox="0 0 XXX YYY" width="100%" xmlns:xlink="http://www.w3.org/1999/xlink"> <image height="YYY" width="XXX" xlink:href="../Images/your_image.jpg"/> </svg> </div> <p>blah, blah, blah,...any extension of text</p> Last edited by RbnJrg; 06-14-2025 at 01:40 PM. |
||||
![]() |
![]() |
Advert | |
|
![]() |
#36 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 427
Karma: 65460
Join Date: Jun 2011
Device: Kindle
|
Yeah, RbnJrg, I see we're kind of talking past each other, and I apologize for that. As I mentioned before, I have no doubt that the svg solutions you've proposed would pre-empt the problems of a non-svg approach. The nature of my question in post #33 wasn't really about HOW to get a full screen, proportional image (a problem for which you've already provided extremely thorough responses), but rather a questions about WHY the non-svg approach was behaving in the way that it did.
So, for example, while you have a solution to fitting the image on a single page (by reducing the height to 99%, which is what I had done and adding a contingent vh specification), I'm puzzled by why 100% height would produce greater than 100% height in the non-svg example, despite having set the html, body, and container to 100% as per the Josh Comeau article. Likewise, I understand that an SVG wrapper would preempt the variously scrolling/squeezing issues, but don't understand why Sigil treats it one way and Calibre treats it another. Last edited by ElMiko; 06-14-2025 at 02:53 PM. |
![]() |
![]() |
![]() |
#37 | |||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,711
Karma: 8700123
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
Code:
html, body { height: 100%; margin: 0; padding: 0; overflow: hidden; } https://elementor.com/blog/vh/ Pay attention when the article says: Quote:
Quote:
PS: You are using "%" and not "vh". With "vh" you don't need to style the <html> tag; the problem here is that ereaders based on RMSDK don't support "vh" and you are forced to employ "%" ![]() Last edited by RbnJrg; 06-14-2025 at 05:58 PM. |
|||
![]() |
![]() |
![]() |
#38 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 427
Karma: 65460
Join Date: Jun 2011
Device: Kindle
|
Interesting....
So, to be clear, I don't have a problem with the scrollbar per se. I mean, if it is necessary to see the whole image then I definitely want it! What I think I'm seeing now is that even at 100%, the vertical scroll bar is actually just showing a sliver of white space below the image, not actually revealing any more of the image (and i assume this is what you mean by "that means nothing"). So what's really happening (I think...???) is that the picture IS 100% of the window height... its just that the container is greater than 100% of the window height, hence the extra little sliver of whitespace that results in the scrollbar (unless you hide "overflow"). Regarding how the two programs render it, I'm seeing that Calibre proportionally resizes the image when you narrow or widen the window, but Sigil stretches the image if you widen the window (which you alluded to in your first post). If you set the image width to "auto", again, Calibre proportionally resizes the image when you widen or narrow the window. Basically, it doesn't allow for overflow—hidden or not. In Sigil/Preview, widening the window preserves the aspect ratio just fine, BUT narrowing the window results in the left side of the image being cut off (presumably because the overflow has been hidden). Now.... here's where things go completely off the rails. If I use the attached "Test1" file which seems to be the same as yours except that I've switched out your image for my image, setting width to "auto" results in a squishy image in Calibre! If i change your image to "auto", it resizes perfectly in Calibre (but cuts off the image in Sigil); if i use the same code on MY image, it gets squished in Calibre. I've attached both your file (modified to "auto") and mine... P.S. one important thing I learned is that <p> has embedded margins, while <div> does not, so I've changed that container for the image itself, as per your example. P.P.S. Does anyone here know how we can just instantly upload knowledge to our brains as in The Matrix? That would save me a lot of time. kthxbye. Last edited by ElMiko; 06-14-2025 at 07:23 PM. |
![]() |
![]() |
![]() |
#39 | ||||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,711
Karma: 8700123
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
Quote:
Quote:
Quote:
|
||||
![]() |
![]() |
![]() |
#40 | ||
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 427
Karma: 65460
Join Date: Jun 2011
Device: Kindle
|
Quote:
Quote:
|
||
![]() |
![]() |
![]() |
#41 |
Connoisseur
![]() Posts: 73
Karma: 10
Join Date: Dec 2024
Device: Tolino Shine 5
|
|
![]() |
![]() |
![]() |
#42 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,561
Karma: 145863177
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
When you code for backwards comparability, you have to assume that ePub3 specific features may not work. |
|
![]() |
![]() |
![]() |
#43 | |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,339
Karma: 20171571
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Quote:
The old coding works but isn’t very pretty, but if the device/app can use the new coding it automatically does and is all nice and pretty! |
|
![]() |
![]() |
![]() |
#44 | |
Connoisseur
![]() Posts: 73
Karma: 10
Join Date: Dec 2024
Device: Tolino Shine 5
|
Quote:
Having a fallback solution is easy enough to implement. It’s not as if ePub3s shoulnd't exist because Kobo won’t support that format and keeps using a decade old renderer. They can only get away with this because so many publishers keep their epubs backwards compatible. The pressure to fix this is way too low. On the Tolino Shine 5, using vh is the only way I can make full page images work (at least without switching back to the ancient RMSDK). Setting html and body to 100% height won't do the trick. It will still display a line of text under a 100% height SVG, so it seems their renderer for some reason requires an ePub3-compatible solution. |
|
![]() |
![]() |
![]() |
#45 | ||||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,711
Karma: 8700123
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
Quote:
Quote:
Quote:
|
||||
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
CSS Styling based on class/existing styling | 1ily | Calibre | 8 | 03-17-2025 06:37 AM |
Incorrect styling with specific CSS | quiris | Marvin | 9 | 07-04-2016 01:04 PM |
Missing CSS properties | roger64 | KOReader | 0 | 06-01-2016 06:39 AM |
inspect image properties /replace image | cybmole | Sigil | 6 | 02-05-2013 12:46 PM |
Unsetting properties in CSS | Jellby | ePub | 2 | 06-03-2009 04:29 AM |