[fix] quality and autoorient need to be in the cache
This commit is contained in:
parent
a3a1451a5c
commit
3818012f91
@ -68,14 +68,26 @@ class Image(object):
|
|||||||
def __init__(self, options):
|
def __init__(self, options):
|
||||||
# assuming string
|
# assuming string
|
||||||
if not isinstance(options, dict):
|
if not isinstance(options, dict):
|
||||||
name = options
|
|
||||||
options = {"name": options}
|
options = {"name": options}
|
||||||
|
|
||||||
self.name = name
|
if not options.has_key("quality"):
|
||||||
self.quality = options.get("quality", DEFAULT_GM_QUALITY)
|
options["quality"] = DEFAULT_GM_QUALITY
|
||||||
self.autoorient = options.get("auto-orient", DEFAULT_GM_AUTOORIENT)
|
if not options.has_key("autoorient"):
|
||||||
|
options["autoorient"] = DEFAULT_GM_AUTOORIENT
|
||||||
|
|
||||||
self.options = options.copy() # used for caching, if it's modified -> regenerate
|
self.options = options.copy() # used for caching, if it's modified -> regenerate
|
||||||
del self.options["name"]
|
|
||||||
|
@property
|
||||||
|
def name(self):
|
||||||
|
return self.options["name"]
|
||||||
|
|
||||||
|
@property
|
||||||
|
def quality(self):
|
||||||
|
return self.options["quality"]
|
||||||
|
|
||||||
|
@property
|
||||||
|
def autoorient(self):
|
||||||
|
return self.options["autoorient"]
|
||||||
|
|
||||||
def copy(self):
|
def copy(self):
|
||||||
source, target = os.path.join(self.base_dir, self.name), os.path.join(self.target_dir, self.name)
|
source, target = os.path.join(self.base_dir, self.name), os.path.join(self.target_dir, self.name)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user