Quote:
Originally Posted by RbnJrg
Well, you want a solution for epub2. With this restriction in mind, you'll need to use an SVG wrapper and assign it the "display: inline-block; width: 100%; margin: 1em 0; text-indent:0" properties. This seems to work:
Crop to content the image before including it in the svg wrapper and use margins (or paddings) to add blank spaces. Of course, I set "margin; 1em 0" but you can set the values you want.
|
@RbnJrg - From what I can tell the 4em height isn't ever being applied here; the size is always being determined by the screen width (i.e. scaled to fit at 100% of the screen width). What I'm trying to reproduce is the way Kindle OS handles image heights that would result an an image that doesn't fit the screen (either because it's too tall or because it's too wide). Namely, it will honor the defined height unless the resulting image is too large for the screen, at which point it will resize the image to fit the screen (maintaining its original aspect ratio). For images that are wider than they are tall, this means it will make the image fill 100% of the width of the window; for images that are taller than they are wide, it will make the image fill 100% of the height of the window.
What I'm trying to acheive in epub is a similar kind of contingent behavior whereby the original height parameter is honored UNLESS it results in an image that is too large, at which point it is resized (proportionally) as described above.
To be clear, what I'm looking for may not be possible; I just hoped that since the behavior could be defined (at least in one case) at the OS level, it could also be explicitly defined at the input level...