mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Catalog output: Make thumbnails larger for EPUB output
This commit is contained in:
parent
391a47369d
commit
4275fe65d3
@ -1211,10 +1211,8 @@ class EPUB_MOBI(CatalogPlugin):
|
|||||||
imgTag['src'] = "../images/thumbnail_default.jpg"
|
imgTag['src'] = "../images/thumbnail_default.jpg"
|
||||||
imgTag['alt'] = "cover"
|
imgTag['alt'] = "cover"
|
||||||
|
|
||||||
# Tweak image size if we're building for Sony, not sure why this is needed
|
# Tweak image size if we're building EPUB, not sure why this is needed
|
||||||
if self.opts.fmt == 'epub' and self.opts.output_profile.startswith("sony"):
|
if self.opts.fmt == 'mobi':
|
||||||
imgTag['style'] = 'width: %dpx; height:%dpx;' % (self.THUMB_WIDTH * 2, self.THUMB_HEIGHT * 2)
|
|
||||||
else:
|
|
||||||
imgTag['style'] = 'width: %dpx; height:%dpx;' % (self.THUMB_WIDTH, self.THUMB_HEIGHT)
|
imgTag['style'] = 'width: %dpx; height:%dpx;' % (self.THUMB_WIDTH, self.THUMB_HEIGHT)
|
||||||
thumbnailTag = body.find(attrs={'class':'thumbnail'})
|
thumbnailTag = body.find(attrs={'class':'thumbnail'})
|
||||||
thumbnailTag.insert(0,imgTag)
|
thumbnailTag.insert(0,imgTag)
|
||||||
@ -2928,7 +2926,8 @@ class EPUB_MOBI(CatalogPlugin):
|
|||||||
self.opts.log.error('generateThumbnail(): Cannot clone cover')
|
self.opts.log.error('generateThumbnail(): Cannot clone cover')
|
||||||
raise RuntimeError
|
raise RuntimeError
|
||||||
# img, width, height
|
# 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.MagickWriteImage(thumb, os.path.join(image_dir, thumb_file))
|
||||||
pw.DestroyMagickWand(thumb)
|
pw.DestroyMagickWand(thumb)
|
||||||
pw.DestroyMagickWand(img)
|
pw.DestroyMagickWand(img)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user