EPUB Output: When rescaling images froma comic use the same screen size as used by the input plugin

This commit is contained in:
Kovid Goyal 2010-04-13 08:45:03 +05:30
parent f25d0f1ef2
commit a5eeb6724d

View File

@ -27,9 +27,12 @@ class RescaleImages(object):
except ImportError: except ImportError:
import Image as PILImage import Image as PILImage
is_image_collection = getattr(self.opts, 'is_image_collection', False)
if is_image_collection:
page_width, page_height = self.opts.dest.comic_screen_size
else:
page_width, page_height = self.opts.dest.width, self.opts.dest.height page_width, page_height = self.opts.dest.width, self.opts.dest.height
if not getattr(self.opts, 'is_image_collection', False):
page_width -= (self.opts.margin_left + self.opts.margin_right) * self.opts.dest.dpi/72. page_width -= (self.opts.margin_left + self.opts.margin_right) * self.opts.dest.dpi/72.
page_height -= (self.opts.margin_top + self.opts.margin_bottom) * self.opts.dest.dpi/72. page_height -= (self.opts.margin_top + self.opts.margin_bottom) * self.opts.dest.dpi/72.
for item in self.oeb.manifest: for item in self.oeb.manifest: