View Single Post
Old 07-21-2015, 03:55 PM   #1
Vanguard3000
Groupie
Vanguard3000 ought to be getting tired of karma fortunes by now.Vanguard3000 ought to be getting tired of karma fortunes by now.Vanguard3000 ought to be getting tired of karma fortunes by now.Vanguard3000 ought to be getting tired of karma fortunes by now.Vanguard3000 ought to be getting tired of karma fortunes by now.Vanguard3000 ought to be getting tired of karma fortunes by now.Vanguard3000 ought to be getting tired of karma fortunes by now.Vanguard3000 ought to be getting tired of karma fortunes by now.Vanguard3000 ought to be getting tired of karma fortunes by now.Vanguard3000 ought to be getting tired of karma fortunes by now.Vanguard3000 ought to be getting tired of karma fortunes by now.
 
Posts: 169
Karma: 474196
Join Date: Jan 2011
Location: Canada
Device: Kobo Libra 2
Resizing images, retaining width-height rato, and only if necessary.

Hi, folks.

I'm putting together an ebook (epub for kobo glo) and it has a lot of scanned images, diagrams, etc, that must be large to be read or otherwise appreciated, but in some cases (or, should I open the document with a smaller-screened ereader), I'd like the image to be automatically scaled down to fit the screen width or height (whichever it needs to do to fully fit on screen).

I've looked through a lot of topics here, on stackoverflow, etc, but there seems to be conflicting opinions regarding width vs max-width and so forth, so I figured I'd just ask and see what happens. So, to lay out what I need:

-Image dimensions must be preserved, i.e., an image of 800x600px must retain a 4:3 aspect ratio (obviously, I don't want the image to be stretched or smeared)
-If resizing is necessary, it should only be reduced in size. I don't need the image to be blown up to fit a screen; only shrunk down to fit.
-The image must fit fully onto the screen so that either the horizontal or vertical sides of the image touch the sides of the ereader margins.

Any help would be appreciated. Thanks in advance.
Vanguard3000 is offline   Reply With Quote