Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Devices

Notices

Reply
 
Thread Tools Search this Thread
Old 09-13-2018, 12:18 PM   #1
board12
Junior Member
board12 began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Sep 2018
Device: PC
Calibre images stretch vertically


Calibre for Windows [epub]:

Narrowing width of window makes images stretch vertically.

How can I maintain image's aspect ratio?
board12 is offline   Reply With Quote
Old 09-13-2018, 11:23 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,951
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The viewer will simply use whatever aspect ratio setting is int he file it is vieweing. So if you dont want the images stretched do a conversion to EPUB enabling the option in the epub output section of the conversion dialog to preserve cover ratio
kovidgoyal is offline   Reply With Quote
Advert
Old 09-30-2018, 07:26 PM   #3
Chrystalline
Enthusiast
Chrystalline began at the beginning.
 
Posts: 37
Karma: 10
Join Date: Aug 2015
Device: pc
I'm feeling pretty stupid about now. It took me a ridiculously long time to figure out that the Preserve Aspect Ratio option was only available in Preferences>Conversion:Output Options

I kept trying to find it in right-click>Convert Books>Convert Individually or Bulk Convert

Maybe the individual/bulk conversion menu could have a shortcut to the Preferences, or some notation that indicates how the main Preferences have been set? Sort of a "hey, these things are over there if that's what you're wanting to change" Maybe like the hints that "float" on mouseover? I don't know the best way, I just know that I've been avoiding epub format for a long time because I couldn't figure it out, and I hate badgering people who give me nifty software for free. (and it is awesome - Calibre is lightyears ahead of Adobe Digital Editions and Amazon's Kindle-for-PC and pretty much all the Android apps - thank you again!)

The first time I tried to convert epub to epub, it told me there was already an epub and asked me if I really wanted to do that. Now that I've set the Preserve Aspect Ratio in Preferences, I tried epub to epub, but it creates another file and marks one of them an unknown format.

Apparently I need to convert to an intermediary format and then back to epub. LRF seems to work, but is there a particular format that is best for preserving the original image ratios before/during conversion back to epub? Other threads make it clear that some formats don't have the option to preserve aspect ratio. I don't understand enough about the formats to really figure out the best way to do this.

Whenever possible, I've been using plain HTML in my browser. I read primarily on my laptop, which is widescreen, so this and the trouble I have with continuous scrolling (ie, it is continuous only within the chapter, and snaps to the start of the next chapter when the bottom of the page is the end of a chapter) are my main issues with epub format. (Well, that and the graphic novel publishers who bunch up page images in epub when I'd rather just open the uncompressed image folder in Irfanview where I can use the keyboard to zoom/advance, but that's another thing entirely.)
Chrystalline is offline   Reply With Quote
Old 10-01-2018, 12:15 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,951
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
do an epub to epub conversion the original epub becomes a file with the extension file.original_epub so you can restore it if the conversion did something you dont like.
kovidgoyal is offline   Reply With Quote
Old 10-05-2018, 06:13 PM   #5
Chrystalline
Enthusiast
Chrystalline began at the beginning.
 
Posts: 37
Karma: 10
Join Date: Aug 2015
Device: pc
That doesn't seem to be how it works when I do it?

If I convert epub to epub, it does create another file and label the old with .original_epub, but the new one still has the same stretching issue. If I start from a pre-existing LRF and convert to epub, it still has the stretching issue. If I convert from epub to LRF, remove the epub, and convert the new LRF to epub, it fixes it. I have no idea why, but it seems to be consistent.
Chrystalline is offline   Reply With Quote
Advert
Old 10-05-2018, 09:32 PM   #6
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,951
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Make sure you are setting the correct option in the conversion dialog when you are converting and you should be fine. If not, then open a bug report and attach one of these epub files, and I will take a look.
kovidgoyal is offline   Reply With Quote
Old 05-09-2024, 01:08 PM   #7
Liudprand
Zealot
Liudprand began at the beginning.
 
Posts: 129
Karma: 10
Join Date: Nov 2021
Device: Kobo Libra 2
Can just I ask: does this instruction apply just to the cover, or to all of the images in the book globally?
Liudprand is offline   Reply With Quote
Old 05-09-2024, 01:11 PM   #8
Liudprand
Zealot
Liudprand began at the beginning.
 
Posts: 129
Karma: 10
Join Date: Nov 2021
Device: Kobo Libra 2
It's just that, in your initial response, you refer to "images" (plural), but then later say "preserve cover ratio".
Liudprand is offline   Reply With Quote
Old 05-09-2024, 01:11 PM   #9
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,951
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The options name is "Preserve cover aspect ratio" should be pretty self explanatory.
kovidgoyal is offline   Reply With Quote
Old 05-09-2024, 01:12 PM   #10
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 36,169
Karma: 145735366
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
As the checkbox say, Preserve cover aspect ratio. For images in the book, you might want to try setting width=xx%; and height=auto; in the CSS.
DNSB is offline   Reply With Quote
Old 05-09-2024, 03:54 PM   #11
Liudprand
Zealot
Liudprand began at the beginning.
 
Posts: 129
Karma: 10
Join Date: Nov 2021
Device: Kobo Libra 2
Quote:
Originally Posted by DNSB View Post
As the checkbox say, Preserve cover aspect ratio. For images in the book, you might want to try setting width=xx%; and height=auto; in the CSS.
Thanks for this. So, "auto", in this context, means preserving the aspect ratio?

Also, is there any way of adding a global instruction to an epub file that will apply the setting to all images?
Liudprand is offline   Reply With Quote
Old 05-09-2024, 04:09 PM   #12
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 36,169
Karma: 145735366
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by Liudprand View Post
Thanks for this. So, "auto", in this context, means preserving the aspect ratio?

Also, is there any way of adding a global instruction to an epub file that will apply the setting to all images?
Auto does not quite mean preserve aspect ratio, but it comes close. Basically, the height will be set to the image height after applying the width constraint. You may want to check for more information on the Internet, for instance: CSS Height, Width and Max-width for some basics.

You could try adding:

Code:
img {
height: auto  !important;
}
to the start of the CSS stylesheet and checking other image references to remove height references that are fixed.

The width percentage depends on the image. I generally go generic and use values such as 95% for near full page width images, 50%/33% for most images within the ebook such as author headshots and 20% for scene separator images.

A lot of that comes down to personal preferences. One friend of mine tends to divide the image width in pixels by 6 and use that as the % which makes his images vary more in size. the 6 comes from his old ereader which had a 600x800 screen so dividing the pixels by 6 gave him the percentage of screen width.
DNSB is offline   Reply With Quote
Old 05-09-2024, 04:24 PM   #13
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,900
Karma: 55267620
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Auto to me is do the other part.
It does not mean preserve.
I specify width and TAKE what auto gives me for height.
But that is for full page images.
Ya gotta help with small images or you might get biggun's
theducks is offline   Reply With Quote
Old 05-09-2024, 04:40 PM   #14
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 36,169
Karma: 145735366
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by theducks View Post
Auto to me is do the other part.
It does not mean preserve.
I specify width and TAKE what auto gives me for height.
But that is for full page images.
Ya gotta help with small images or you might get biggun's
ASSuming the container is large enough, auto comes pretty close to preserve aspect ratio.

If I have images that are vertically oriented, I might go with width: auto; and set the height by percentage. Or I might go for the full sextet of height, max-height, min-height, width, max-width and min-width.

And then there was one abomination where the author used JavaScript so you had image/box sizes that were theoretically sized to the screen dimensions. That was a total CF of an ePub partly due the author not being very familiar with JS and copy/pasting a lot of the code from the web. They were very unhappy when I simplified the code to make the use of JS unnecessary despite the fact that his original ePub caused KDP to generate enough error messages to make them useless for troubleshooting. Evidently, they read somewhere that their ebook would work everywhere because everything supports JS.
DNSB is offline   Reply With Quote
Old 05-10-2024, 08:42 AM   #15
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 11,389
Karma: 87013929
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
Quote:
Originally Posted by DNSB View Post
Evidently, they read somewhere that their ebook would work everywhere because everything supports JS.

Most physical ereaders and many apps don't. There are even web browsers that don't support JS.
Also not all JS makes sense in a ebook even if JS does work.

But you know all this

I do preview on a 4.3″ android and 5″ and 4.7″ eink as well as big screens, in mobi, azw3 and epub. I may stop checking mobi. Only four very ancient Kindles don't support azw3/KF8 and anyone with a non-Kindle only doing mobi (some old phones & PDAs?) likely has Calibre by now, or buying a new ereader.

Width or height for auto mostly works.

An oddity is that on some Kobo FW if an image is specified in pt (using px or % is better), the image does scale with user font selection. 12pt ought to be 1em. 12pt might be 16 px, when at default size. None of that applies to paper and may not apply to browsers. Also 1 px is a logical pixel. It might not be one screen dot.

Last edited by Quoth; 05-10-2024 at 08:52 AM.
Quoth is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Stretch the cover to fit the screen? ZodWallop Kobo Reader 23 06-30-2018 09:17 AM
How to align/stretch images in the ebook knowledgecrawler Recipes 1 08-24-2014 01:04 PM
Do Kindle covers stretch to fit? Stodder Kindle Formats 4 01-22-2014 04:35 AM
Hello I am not a expert by any stretch kbdbloak Introduce Yourself 4 05-27-2011 09:12 AM
Images flipped vertically when converting from PDF kataleen Calibre 1 12-16-2010 02:26 AM


All times are GMT -4. The time now is 08:54 AM.


MobileRead.com is a privately owned, operated and funded community.