[SNBOutput] Improve handling of comics, read screen size from profile.

This commit is contained in:
Li Fanxi 2010-10-14 21:19:08 +08:00
parent 8d26343231
commit 565295b353
2 changed files with 8 additions and 3 deletions

View File

@ -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]

View File

@ -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,7 +225,10 @@ class SNBOutput(OutputFormatPlugin):
img = Image()
img.load(imageData)
(x,y) = img.size
# TODO use the data from device profile
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