![]() |
#1 |
Member
![]() Posts: 21
Karma: 10
Join Date: Dec 2010
Location: Nanuet, NY
Device: nook kindle
|
Constrain Proportions of Cover Image?
Hi All,
I'm using calibre and sigil, mostly, and have nice epub, lit, and mobi versions of my book. Yay! One problem. My cover expands to fit the window and looks awful. Is there any code I can plug in (in the .opf, possibly?) to get the image to constrain to its proportions? I think I saw this somewhere and can't remember what i did. Thank you. markjoseph www.thewordgang.com |
![]() |
![]() |
![]() |
#2 |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,543
Karma: 19001583
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Do not use "width: 100%; height: 100%", use instead: "max-width: 100%; max-height: 100%"
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Member
![]() Posts: 21
Karma: 10
Join Date: Dec 2010
Location: Nanuet, NY
Device: nook kindle
|
Thanks Jelby, I must be doing something wrong. Tried it in both opf files a la:
<guide> <reference href="cover.jpg" type="cover" title="Cover" max-width="100%" max-height="100%"/> </guide> </package> and it didn't constrain the cover image. There's a "metadata.opf" as well as a "Word Gang, The - Mark McKenna.opf" file. I tried it in both of them and monkeyed around with the "" and :'s. Now what? markjoseph |
![]() |
![]() |
![]() |
#4 |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,543
Karma: 19001583
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
You cannot use CSS code in the OPF.
If "cover.jpg" is used in some XHTML file, in a <img> element, then there's where you have to add/modify the CSS (have a look at some tutorial on HTML/CSS to know what you are doing). If "cover.jpg" is only referred in that guide element, then I don't think there's nothing you can do, and the reader is just buggy. |
![]() |
![]() |
![]() |
#5 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,884
Karma: 59840450
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Are you supposed to quot the 100% in a Guide?
You don't in a style sheet |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,156
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Under epub output in the calibre conversion settings check preserve aspect ratio
|
![]() |
![]() |
![]() |
#7 |
Member
![]() Posts: 21
Karma: 10
Join Date: Dec 2010
Location: Nanuet, NY
Device: nook kindle
|
Thanks Kovid, I knew i saw it somewhere. (Add another point to your karma.) I'll add some $$ points as soon as I receive some of the New Year's cheer I've been expecting. To fix the cover I'm going to try to go epub to epub. I think I did this before and it worked. Is that a good practice? markjoseph
|
![]() |
![]() |
![]() |
#8 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,156
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
that is the most reliable way to fix epub covers.
|
![]() |
![]() |
![]() |
Tags |
constrain, cover, image, proportions |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Cover image size | crutledge | Sigil | 3 | 08-02-2010 03:31 AM |
Cover Image Compression. | Ichi | Calibre | 3 | 01-04-2010 06:38 AM |
Center a cover image | Crusader | Sigil | 2 | 10-18-2009 08:51 AM |
back Cover image | itimpi | Calibre | 2 | 10-14-2009 12:03 PM |
Cover Image Display | JoeD | OpenInkpot | 9 | 05-05-2009 12:42 AM |