small enhancement in webp_import
This commit is contained in:
parent
a2a91c5653
commit
57080c9ced
@ -25,10 +25,10 @@ class WebpImport(inkex.InputExtension):
|
|||||||
convertfile = os.path.join(tmp, "webp.png")
|
convertfile = os.path.join(tmp, "webp.png")
|
||||||
if shutil.which('magick'):
|
if shutil.which('magick'):
|
||||||
command = "magick \"%s\" \"%s\" " % (self.options.inputfile, convertfile)
|
command = "magick \"%s\" \"%s\" " % (self.options.inputfile, convertfile)
|
||||||
elif shutil.which('convert'):
|
elif os.name != 'nt' and shutil.which('convert'): #on Windows this command is reserved for some HDD actions
|
||||||
command = "convert \"%s\" \"%s\" " % (self.options.inputfile, convertfile)
|
command = "convert \"%s\" \"%s\" " % (self.options.inputfile, convertfile)
|
||||||
else:
|
else:
|
||||||
inkex.errormsg('ImageMagick does not appear to be installed.')
|
inkex.errormsg('ImageMagick does not appear to be installed. Get it from https://imagemagick.org/script/download.php')
|
||||||
exit()
|
exit()
|
||||||
p = subprocess.Popen(command, shell=True)
|
p = subprocess.Popen(command, shell=True)
|
||||||
return_code = p.wait()
|
return_code = p.wait()
|
||||||
|
Loading…
Reference in New Issue
Block a user