[mod] remove indentation level
This commit is contained in:
parent
820dd267d4
commit
05078aaa57
@ -122,23 +122,23 @@ class Image(object):
|
|||||||
return self.options["name"]
|
return self.options["name"]
|
||||||
|
|
||||||
def gm(self, source, target, options):
|
def gm(self, source, target, options):
|
||||||
if CACHE.needs_to_be_generated(source, target, options):
|
if not CACHE.needs_to_be_generated(source, target, options):
|
||||||
gm_switches = {
|
|
||||||
"source": source,
|
|
||||||
"target": target,
|
|
||||||
"auto-orient": "-auto-orient" if options["auto-orient"] else "",
|
|
||||||
"strip": "-strip" if options["strip"] else "",
|
|
||||||
"quality": "-quality %s" % options["quality"] if "quality" in options else "-define jpeg:preserve-settings",
|
|
||||||
"resize": "-resize %s" % options["resize"] if options.get("resize", None) is not None else ""
|
|
||||||
}
|
|
||||||
command = "gm convert {source} {auto-orient} {strip} {quality} {resize} {target}".format(**gm_switches)
|
|
||||||
warning("Generation", source)
|
|
||||||
print(command)
|
|
||||||
os.system(command)
|
|
||||||
CACHE.cache_picture(source, target, options)
|
|
||||||
else:
|
|
||||||
okgreen("Skipped", source + " is already generated")
|
okgreen("Skipped", source + " is already generated")
|
||||||
|
|
||||||
|
gm_switches = {
|
||||||
|
"source": source,
|
||||||
|
"target": target,
|
||||||
|
"auto-orient": "-auto-orient" if options["auto-orient"] else "",
|
||||||
|
"strip": "-strip" if options["strip"] else "",
|
||||||
|
"quality": "-quality %s" % options["quality"] if "quality" in options else "-define jpeg:preserve-settings",
|
||||||
|
"resize": "-resize %s" % options["resize"] if options.get("resize", None) is not None else ""
|
||||||
|
}
|
||||||
|
command = "gm convert {source} {auto-orient} {strip} {quality} {resize} {target}".format(**gm_switches)
|
||||||
|
warning("Generation", source)
|
||||||
|
print(command)
|
||||||
|
os.system(command)
|
||||||
|
CACHE.cache_picture(source, target, options)
|
||||||
|
|
||||||
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