From 4275fe65d30b9b24717e2b97251f9097b16f5c0b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 7 Feb 2010 11:56:32 -0700 Subject: [PATCH] Catalog output: Make thumbnails larger for EPUB output --- src/calibre/library/catalog.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/calibre/library/catalog.py b/src/calibre/library/catalog.py index 85bd21692b..f24d04286d 100644 --- a/src/calibre/library/catalog.py +++ b/src/calibre/library/catalog.py @@ -1211,10 +1211,8 @@ class EPUB_MOBI(CatalogPlugin): imgTag['src'] = "../images/thumbnail_default.jpg" imgTag['alt'] = "cover" - # Tweak image size if we're building for Sony, not sure why this is needed - if self.opts.fmt == 'epub' and self.opts.output_profile.startswith("sony"): - imgTag['style'] = 'width: %dpx; height:%dpx;' % (self.THUMB_WIDTH * 2, self.THUMB_HEIGHT * 2) - else: + # Tweak image size if we're building EPUB, not sure why this is needed + if self.opts.fmt == 'mobi': imgTag['style'] = 'width: %dpx; height:%dpx;' % (self.THUMB_WIDTH, self.THUMB_HEIGHT) thumbnailTag = body.find(attrs={'class':'thumbnail'}) thumbnailTag.insert(0,imgTag) @@ -2928,7 +2926,8 @@ class EPUB_MOBI(CatalogPlugin): self.opts.log.error('generateThumbnail(): Cannot clone cover') raise RuntimeError # img, width, height - pw.MagickThumbnailImage(thumb, self.THUMB_WIDTH, self.THUMB_HEIGHT) + factor = 2 if self.opts.fmt == 'epub' else 1 + pw.MagickThumbnailImage(thumb, factor*self.THUMB_WIDTH, factor*self.THUMB_HEIGHT) pw.MagickWriteImage(thumb, os.path.join(image_dir, thumb_file)) pw.DestroyMagickWand(thumb) pw.DestroyMagickWand(img)