From 4e6353468b53ed817a5e4e0dfbdccca7ae7531a3 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 19 Sep 2019 18:29:24 +0530 Subject: [PATCH] Fix small cover images not being vertically centered --- src/calibre/ebooks/oeb/polish/cover.py | 2 +- src/calibre/srv/render_book.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/calibre/ebooks/oeb/polish/cover.py b/src/calibre/ebooks/oeb/polish/cover.py index 98ae45277a..e89ffefeda 100644 --- a/src/calibre/ebooks/oeb/polish/cover.py +++ b/src/calibre/ebooks/oeb/polish/cover.py @@ -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) diff --git a/src/calibre/srv/render_book.py b/src/calibre/srv/render_book.py index 35f2da9956..8c4d1c52b1 100644 --- a/src/calibre/srv/render_book.py +++ b/src/calibre/srv/render_book.py @@ -263,7 +263,9 @@ class Container(ContainerBase): 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; } '''