mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 04:27:13 +02:00
Fix wide covers being cut-off on the right
This commit is contained in:
parent
0875953364
commit
6cf5c845da
2 changed files with 7 additions and 3 deletions
|
|
@ -239,8 +239,12 @@ def create_cover_page(self, input_fmt):
|
|||
templ = '''
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
||||
<head><style>
|
||||
html, body, img { height: 100%%; display: block; margin: 0; padding: 0; border-width: 0; }
|
||||
img { width: auto; margin-left:auto; margin-right: auto; }
|
||||
html, body, img { height: 100vh; display: block; margin: 0; padding: 0; border-width: 0; }
|
||||
img {
|
||||
width: auto; height: auto;
|
||||
margin-left: auto; margin-right: auto;
|
||||
max-width: 100vw; max-height: 100vh
|
||||
}
|
||||
</style></head><body><img src="%s"/></body></html>
|
||||
'''
|
||||
if input_fmt == 'epub':
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ def do_one():
|
|||
def got_one(data, name, mimetype):
|
||||
if False and name is book.manifest.title_page_name:
|
||||
# Enable to have cover image not preserve aspect ratio
|
||||
data = data.replace('width: auto', 'width: 100%')
|
||||
data = data.replace('width: auto; height: auto', 'width: 100vw; height: 100vh')
|
||||
ans[name] = v'[data, mimetype]'
|
||||
if jstype(data) is 'string':
|
||||
find_virtualized_resources(data)
|
||||
|
|
|
|||
Loading…
Reference in a new issue