Metadata download: Do not auto trim downloaded covers

Trimming can sometimes have undesirable effects.
This commit is contained in:
Kovid Goyal 2013-11-03 22:49:11 +05:30
parent e138fde8ac
commit 8f8e5ac6be
2 changed files with 5 additions and 5 deletions

View File

@ -208,6 +208,8 @@ class Source(Plugin):
#: If True this source can return multiple covers for a given query
can_get_multiple_covers = False
#: If set to True covers downloaded by this plugin are automatically trimmed.
auto_trim_covers = False
def __init__(self, *args, **kwargs):
Plugin.__init__(self, *args, **kwargs)
@ -446,11 +448,8 @@ class Source(Plugin):
except Exception:
self.log.exception('Failed to download cover from: %r'%url)
# }}}
# Metadata API {{{
def get_book_url(self, identifiers):
'''
Return a 3-tuple or None. The 3-tuple is of the form:

View File

@ -61,6 +61,7 @@ def process_result(log, result):
try:
im = Image()
im.load(data)
if getattr(plugin, 'auto_trim_covers', False):
im.trim(10)
width, height = im.size
fmt = im.format