mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Change parameter to trim() in comic processing, since the trim function was changed
This commit is contained in:
parent
b12cd7ab03
commit
4491fad3d7
@ -50,7 +50,8 @@ def find_pages(dir, sort_on_mtime=False, verbose=False):
|
|||||||
for datum in os.walk(dir):
|
for datum in os.walk(dir):
|
||||||
for name in datum[-1]:
|
for name in datum[-1]:
|
||||||
path = os.path.join(datum[0], name)
|
path = os.path.join(datum[0], name)
|
||||||
if '__MACOSX' in path: continue
|
if '__MACOSX' in path:
|
||||||
|
continue
|
||||||
for ext in extensions:
|
for ext in extensions:
|
||||||
if path.lower().endswith('.'+ext):
|
if path.lower().endswith('.'+ext):
|
||||||
pages.append(path)
|
pages.append(path)
|
||||||
@ -67,6 +68,7 @@ def find_pages(dir, sort_on_mtime=False, verbose=False):
|
|||||||
return pages
|
return pages
|
||||||
|
|
||||||
class PageProcessor(list): # {{{
|
class PageProcessor(list): # {{{
|
||||||
|
|
||||||
'''
|
'''
|
||||||
Contains the actual image rendering logic. See :method:`render` and
|
Contains the actual image rendering logic. See :method:`render` and
|
||||||
:method:`process_pages`.
|
:method:`process_pages`.
|
||||||
@ -81,7 +83,6 @@ class PageProcessor(list): # {{{
|
|||||||
self.rotate = False
|
self.rotate = False
|
||||||
self.render()
|
self.render()
|
||||||
|
|
||||||
|
|
||||||
def render(self):
|
def render(self):
|
||||||
from calibre.utils.magick import Image
|
from calibre.utils.magick import Image
|
||||||
img = Image()
|
img = Image()
|
||||||
@ -113,10 +114,9 @@ class PageProcessor(list): # {{{
|
|||||||
if self.rotate:
|
if self.rotate:
|
||||||
wand.rotate(pw, -90)
|
wand.rotate(pw, -90)
|
||||||
|
|
||||||
# 25 percent fuzzy trim?
|
|
||||||
if not self.opts.disable_trim:
|
if not self.opts.disable_trim:
|
||||||
wand.trim(25*65535/100)
|
wand.trim(10)
|
||||||
wand.set_page(0, 0, 0, 0) #Clear page after trim, like a "+repage"
|
wand.set_page(0, 0, 0, 0) # Clear page after trim, like a "+repage"
|
||||||
# Do the Photoshop "Auto Levels" equivalent
|
# Do the Photoshop "Auto Levels" equivalent
|
||||||
if not self.opts.dont_normalize:
|
if not self.opts.dont_normalize:
|
||||||
wand.normalize()
|
wand.normalize()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user