mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
[SNBOutput] Improve handling of comics, read screen size from profile.
This commit is contained in:
parent
8d26343231
commit
565295b353
@ -655,6 +655,7 @@ class BambookOutput(OutputProfile):
|
|||||||
|
|
||||||
# Screen size is a best guess
|
# Screen size is a best guess
|
||||||
screen_size = (800, 600)
|
screen_size = (800, 600)
|
||||||
|
comic_screen_size = (700, 540)
|
||||||
dpi = 168.451
|
dpi = 168.451
|
||||||
fbase = 12
|
fbase = 12
|
||||||
fsizes = [10, 12, 14, 16]
|
fsizes = [10, 12, 14, 16]
|
||||||
|
@ -50,6 +50,7 @@ class SNBOutput(OutputFormatPlugin):
|
|||||||
])
|
])
|
||||||
|
|
||||||
def convert(self, oeb_book, output_path, input_plugin, opts, log):
|
def convert(self, oeb_book, output_path, input_plugin, opts, log):
|
||||||
|
self.opts = opts
|
||||||
# Create temp dir
|
# Create temp dir
|
||||||
with TemporaryDirectory('_snb_output') as tdir:
|
with TemporaryDirectory('_snb_output') as tdir:
|
||||||
# Create stub directories
|
# Create stub directories
|
||||||
@ -224,7 +225,10 @@ class SNBOutput(OutputFormatPlugin):
|
|||||||
img = Image()
|
img = Image()
|
||||||
img.load(imageData)
|
img.load(imageData)
|
||||||
(x,y) = img.size
|
(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_X = 540
|
||||||
SCREEN_Y = 700
|
SCREEN_Y = 700
|
||||||
# Handle big image only
|
# Handle big image only
|
||||||
|
Loading…
x
Reference in New Issue
Block a user