return self.exts[self.format]
def save(self, *args, **kwargs):
- return self.final_image().save(format=self.format, quality=95, *args, **kwargs)
+ default_kwargs = {
+ 'format': self.format,
+ 'quality': 95,
+ }
+ default_kwargs.update(kwargs)
+ return self.final_image().save(*args, **default_kwargs)
def output_file(self, *args, **kwargs):
imgstr = StringIO()
if cover:
if cover is True:
cover = DefaultEbookCover
- bound_cover = cover(book_info)
+ bound_cover = cover(book_info, width=1200)
root.set('data-cover-width', str(bound_cover.width))
root.set('data-cover-height', str(bound_cover.height))
if bound_cover.uses_dc_cover:
if cover:
with open(os.path.join(temp, 'cover.png'), 'w') as f:
- bound_cover.save(f)
+ bound_cover.save(f, quality=80)
del document # no longer needed large object :)