![]() |
#31 | ||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,875
Karma: 8821117
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
Quote:
In conclusion, and for an epub3: With a xhtml code of: Code:
<p class="autoImg"><img alt="Hello" src="../Images/Hello.jpg"/></p> Code:
.autoImg { text-indent: 0; text-align: center; max-height: 4em !important; width: auto !important; margin: 0; } .autoImg img { max-width: 100%; margin: 0 auto; border: 1px solid red; display: block; } a) if the window is narrower than would accommodate a 2em height and proportional width (e.g. the WINDOW width is equivalent to 11em), the image is shrunk to fit the screen width-wise, maintaining a proportional height (i.e. resulting in an image that functionally has a height of 1.8333em and a width of 11em). b) if the window is wider than the proportional width of the image at a height of 2em (e.g. 14em wide), it will honor the 2em height with proportionaly width (resulting in 1em of white space to the left and right of the image). c) if the window matches the proportional width of the image at the defined 2em height, it would would look like scenario a, except the image would be exactly 2em (as defined) rather than shrinking to fit the window. I add a border to the image so you can understand better the things. As you can see, you have everything you asked for. PS: I worked with a height of 4em (and not 2em) as you stated in one of your first posts. Last edited by RbnJrg; 10-12-2025 at 09:20 PM. |
||
![]() |
![]() |
![]() |
#32 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 497
Karma: 65460
Join Date: Jun 2011
Device: Kindle
|
The last epub you uploaded had both epub2 and epub3 solutions.
the svg code for the the epub2 solution was: Code:
.svg_inline { display: inline-block; width: 100%; height: auto !important; margin: 0; text-indent: 0; } For the epub3 solution, at a max height of 4em these are the results I get when the window is wide: at a max-height of 2em this is what i get: In all cases, it doesn't seem to care about the max-height value (at least not for determining the height of the image). It just keeps growing to fill the window width-wise. EDIT: I also updated your original file to include the text-alignment and the border as per your latest message, but it made no difference in terms of the above described behavior (the only difference now being that there was a red border... obviously). Last edited by ElMiko; 10-13-2025 at 07:51 PM. |
![]() |
![]() |
Advert | |
|
![]() |
#33 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,875
Karma: 8821117
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
|
|
![]() |
![]() |
![]() |
#34 | |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 497
Karma: 65460
Join Date: Jun 2011
Device: Kindle
|
Quote:
All of this notwithstanding, copying your revised code over the existing code (from your most recent upload), still doesn't get the same results that you appear to be getting. As you can see, the image doesn't have a 4em height despite there being plenty of window space to accomodate it. You would be doing me a HUGE favor if you could share the epub file that produced the 3 images in this post as very clearly, I'm screwing something up in copying and pasting your incremental tweaks. Separately—and again I apologize if i'm missing something subtle here—but I can't find any explanation in your responses to the epub2 conundrum. Or are you just saying that it can't be done? |
|
![]() |
![]() |
![]() |
#35 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,875
Karma: 8821117
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
Epub3_Solution_for_Variable-fixed_image_height.epub It's an epub3 ebook. For epub2, you can only meet points a) and c) of your requirements. To meet point b), you need to limit the height, and that's not possible with ADE Legacy. |
|
![]() |
![]() |
Advert | |
|
![]() |
#36 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 497
Karma: 65460
Join Date: Jun 2011
Device: Kindle
|
That... was incredibly helpful. Lightbulb moment. Thank you.
I think i understand how this is working, and why changing the max-height before was making things overlap in my version. Your code sets the max height at the container level, not the img level. In your epub3 solution, in order set the image height to, say, 2em, I have to add that to the css for ".autoImg img", not just ".autoImg". What I'm still a bit flummoxed by is why this wouldn't work in epub2! I'm not seeing any properties that, individually, aren't recognized by that format. When you say ADE Legacy, I assume you mean this? Or are you saying that any epub2 file will fail to render that image using that combination of css. Also, in the event of failure, what happens? Does the file not open? Or will the image just not render? Or will it render, but not the way we want it to under condition (b)? |
![]() |
![]() |
![]() |
#37 | ||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,875
Karma: 8821117
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
You are welcome
![]() Quote:
Quote:
Last edited by RbnJrg; Today at 12:54 PM. |
||
![]() |
![]() |
![]() |
#38 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 80,585
Karma: 150249619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
You really need to fix the code so it works in older ADE versions. Many people still use old versions of RMSDK such as a lot of Kobo users, Sony Reader users, nook users, etc.
|
![]() |
![]() |
![]() |
#39 | |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,388
Karma: 20212733
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:
Older devices are antiquated. If they can’t keep up with current standards then they might as well be discarded. Or are you only interested in getting rid of Marvin because it is no longer updated??? Can’t have it both ways. |
|
![]() |
![]() |
![]() |
#40 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 80,585
Karma: 150249619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Kobo devices are not antiquated. That's the problem. You can't dismiss them because they are old which they are not. The firmware they can use is new. The Sage, Elipsa 2E, Clara BW, Clara Colour, and Libra Colour are all current Kobo Readers. So your reasoning not to support older RMSDK because the Readers that use it are old is incorrect. Oh and nooks are not old as well.
|
![]() |
![]() |
![]() |
Tags |
image height, image scaling |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
line-height is fixed? | nano5 | Viewer | 5 | 01-25-2025 08:01 AM |
Image height | JSWolf | KOReader | 6 | 03-29-2021 04:29 PM |
QT5 and image height | Turtle91 | Sigil | 23 | 02-21-2013 01:44 PM |
Image height in div | soparch | ePub | 5 | 03-29-2012 01:18 PM |
What image height causes images to fill the screen? | karenbryant | ePub | 7 | 01-04-2012 04:23 AM |