self.title = book_info.title
if format is not None:
self.format = format
+ if width and height:
+ self.height = height * self.width / width
scale = max(float(width or 0) / self.width, float(height or 0) / self.height)
if scale >= 1:
self.scale = scale
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()