From d06947281b63c86ac5215d433aeddb7430736c6a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 28 Jan 2011 10:05:16 -0700 Subject: [PATCH] EPUB Output: When using preserve cover aspect ratio, use the actual image sizes in the SVG template as otherwise ADE doesn't render the images correctly --- src/calibre/ebooks/oeb/transforms/cover.py | 4 ++-- src/calibre/ebooks/pdf/output.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/calibre/ebooks/oeb/transforms/cover.py b/src/calibre/ebooks/oeb/transforms/cover.py index 0d82e9ad73..013d17c321 100644 --- a/src/calibre/ebooks/oeb/transforms/cover.py +++ b/src/calibre/ebooks/oeb/transforms/cover.py @@ -141,8 +141,8 @@ class CoverManager(object): if width is None or height is None: self.log.warning('Failed to read cover dimensions') width, height = 600, 800 - if self.preserve_aspect_ratio: - width, height = 600, 800 + #if self.preserve_aspect_ratio: + # width, height = 600, 800 self.svg_template = self.svg_template.replace('__viewbox__', '0 0 %d %d'%(width, height)) self.svg_template = self.svg_template.replace('__width__', diff --git a/src/calibre/ebooks/pdf/output.py b/src/calibre/ebooks/pdf/output.py index 7fa7a0cf4c..24050abf6a 100644 --- a/src/calibre/ebooks/pdf/output.py +++ b/src/calibre/ebooks/pdf/output.py @@ -47,7 +47,7 @@ class PDFOutput(OutputFormatPlugin): OptionRecommendation(name='preserve_cover_aspect_ratio', recommended_value=False, help=_('Preserve the aspect ratio of the cover, instead' - ' of stretching it to fill the ull first page of the' + ' of stretching it to fill the full first page of the' ' generated pdf.') ), ])