mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix wide covers being cut-off on the right
This commit is contained in:
parent
0875953364
commit
6cf5c845da
@ -239,8 +239,12 @@ class Container(ContainerBase):
|
|||||||
templ = '''
|
templ = '''
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
||||||
<head><style>
|
<head><style>
|
||||||
html, body, img { height: 100%%; display: block; margin: 0; padding: 0; border-width: 0; }
|
html, body, img { height: 100vh; display: block; margin: 0; padding: 0; border-width: 0; }
|
||||||
img { width: auto; margin-left:auto; margin-right: auto; }
|
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>
|
</style></head><body><img src="%s"/></body></html>
|
||||||
'''
|
'''
|
||||||
if input_fmt == 'epub':
|
if input_fmt == 'epub':
|
||||||
|
@ -42,7 +42,7 @@ def load_resources(db, book, root_name, previous_resources, proceed):
|
|||||||
def got_one(data, name, mimetype):
|
def got_one(data, name, mimetype):
|
||||||
if False and name is book.manifest.title_page_name:
|
if False and name is book.manifest.title_page_name:
|
||||||
# Enable to have cover image not preserve aspect ratio
|
# 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]'
|
ans[name] = v'[data, mimetype]'
|
||||||
if jstype(data) is 'string':
|
if jstype(data) is 'string':
|
||||||
find_virtualized_resources(data)
|
find_virtualized_resources(data)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user