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 = '''
|
||||
<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 load_resources(db, book, root_name, previous_resources, proceed):
|
||||
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…
x
Reference in New Issue
Block a user