small enhancement in webp_import

This commit is contained in:
Mario Voigt 2024-01-23 22:07:50 +01:00
parent a2a91c5653
commit 57080c9ced

View File

@ -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()