mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-03-06 09:14:39 +01:00
Fix small cover images not being vertically centered
This commit is contained in:
parent
1e57c4180e
commit
4e6353468b
2 changed files with 4 additions and 2 deletions
|
|
@ -487,7 +487,7 @@ def set_epub_cover(container, cover_path, report, options=None):
|
|||
if wrapped_image is not None:
|
||||
# The cover page is a simple wrapper around a single cover image,
|
||||
# we can remove it safely.
|
||||
log('Existing cover page is a simple wrapper, removing it')
|
||||
log('Existing cover page {} is a simple wrapper, removing it'.format(cover_page))
|
||||
container.remove_item(cover_page)
|
||||
if wrapped_image != existing_image:
|
||||
container.remove_item(wrapped_image)
|
||||
|
|
|
|||
|
|
@ -263,7 +263,9 @@ def create_cover_page(self, input_fmt):
|
|||
img {
|
||||
width: auto; height: auto;
|
||||
margin-left: auto; margin-right: auto;
|
||||
max-width: 100vw; max-height: 100vh
|
||||
max-width: 100vw; max-height: 100vh;
|
||||
top: 50vh; transform: translateY(-50%%);
|
||||
position: relative;
|
||||
}
|
||||
</style></head><body><img src="%s"/></body></html>
|
||||
'''
|
||||
|
|
|
|||
Loading…
Reference in a new issue