mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Comic Input: Fix conversion failing when output profile is set to Tablet Output
This commit is contained in:
parent
450b8f4341
commit
c384f93e4b
@ -131,9 +131,12 @@ class PageProcessor(list): # {{{
|
|||||||
newsizey = int(newsizex / aspect)
|
newsizey = int(newsizex / aspect)
|
||||||
deltax = 0
|
deltax = 0
|
||||||
deltay = (SCRHEIGHT - newsizey) / 2
|
deltay = (SCRHEIGHT - newsizey) / 2
|
||||||
wand.size = (newsizex, newsizey)
|
if newsizex < 20000 and newsizey < 20000:
|
||||||
wand.set_border_color(pw)
|
# Too large and resizing fails, so better
|
||||||
wand.add_border(pw, deltax, deltay)
|
# to leave it as original size
|
||||||
|
wand.size = (newsizex, newsizey)
|
||||||
|
wand.set_border_color(pw)
|
||||||
|
wand.add_border(pw, deltax, deltay)
|
||||||
elif self.opts.wide:
|
elif self.opts.wide:
|
||||||
# Keep aspect and Use device height as scaled image width so landscape mode is clean
|
# Keep aspect and Use device height as scaled image width so landscape mode is clean
|
||||||
aspect = float(sizex) / float(sizey)
|
aspect = float(sizex) / float(sizey)
|
||||||
@ -152,11 +155,15 @@ class PageProcessor(list): # {{{
|
|||||||
newsizey = int(newsizex / aspect)
|
newsizey = int(newsizex / aspect)
|
||||||
deltax = 0
|
deltax = 0
|
||||||
deltay = (wscreeny - newsizey) / 2
|
deltay = (wscreeny - newsizey) / 2
|
||||||
wand.size = (newsizex, newsizey)
|
if newsizex < 20000 and newsizey < 20000:
|
||||||
wand.set_border_color(pw)
|
# Too large and resizing fails, so better
|
||||||
wand.add_border(pw, deltax, deltay)
|
# to leave it as original size
|
||||||
|
wand.size = (newsizex, newsizey)
|
||||||
|
wand.set_border_color(pw)
|
||||||
|
wand.add_border(pw, deltax, deltay)
|
||||||
else:
|
else:
|
||||||
wand.size = (SCRWIDTH, SCRHEIGHT)
|
if SCRWIDTH < 20000 and SCRHEIGHT < 20000:
|
||||||
|
wand.size = (SCRWIDTH, SCRHEIGHT)
|
||||||
|
|
||||||
if not self.opts.dont_sharpen:
|
if not self.opts.dont_sharpen:
|
||||||
wand.sharpen(0.0, 1.0)
|
wand.sharpen(0.0, 1.0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user