View Single Post
Old Yesterday, 08:09 AM   #16
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,866
Karma: 8821117
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by ElMiko View Post
@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...
With an svg wrapper the only thing you need to do is to add the height you wish to the style .svg_online.

Click image for larger version

Name:	One2.jpg
Views:	12
Size:	183.9 KB
ID:	218388 Click image for larger version

Name:	One1.jpg
Views:	11
Size:	106.1 KB
ID:	218389

Your style would be:

Code:
.svg_inline {
  display: inline-block;
  width: 100%;
  height: 4em; /* Or whatever height you wish */
  margin: 1em 0;
  text-indent: 0;
}
Now, suppose you want a height of 15em; in that case, your output would be:

Click image for larger version

Name:	One3.jpg
Views:	11
Size:	178.3 KB
ID:	218391

Since the svg wrapper maintains the proportion of the image, to honor the height, it will add blank spaces to the picture.
Attached Files
File Type: epub Inlined_Block_SVG.epub (4.6 KB, 4 views)

Last edited by RbnJrg; Yesterday at 08:16 AM.
RbnJrg is offline   Reply With Quote