diff --git a/src/calibre/customize/profiles.py b/src/calibre/customize/profiles.py index bda2103484..4fa53b1cdb 100644 --- a/src/calibre/customize/profiles.py +++ b/src/calibre/customize/profiles.py @@ -655,6 +655,7 @@ class BambookOutput(OutputProfile): # Screen size is a best guess screen_size = (800, 600) + comic_screen_size = (700, 540) dpi = 168.451 fbase = 12 fsizes = [10, 12, 14, 16] diff --git a/src/calibre/ebooks/snb/output.py b/src/calibre/ebooks/snb/output.py index cbe785d384..3aadb79185 100644 --- a/src/calibre/ebooks/snb/output.py +++ b/src/calibre/ebooks/snb/output.py @@ -50,6 +50,7 @@ class SNBOutput(OutputFormatPlugin): ]) def convert(self, oeb_book, output_path, input_plugin, opts, log): + self.opts = opts # Create temp dir with TemporaryDirectory('_snb_output') as tdir: # Create stub directories @@ -224,9 +225,12 @@ class SNBOutput(OutputFormatPlugin): img = Image() img.load(imageData) (x,y) = img.size - # TODO use the data from device profile - SCREEN_X = 540 - SCREEN_Y = 700 + if self.opts: + SCREEN_Y, SCREEN_X = self.opts.output_profile.comic_screen_size + print SCREEN_Y, SCREEN_X + else: + SCREEN_X = 540 + SCREEN_Y = 700 # Handle big image only if x > SCREEN_X or y > SCREEN_Y: SCREEN_RATIO = float(SCREEN_Y) / SCREEN_X