remove deprecation

This commit is contained in:
Mario Voigt 2021-12-25 20:49:39 +01:00
parent 1d7cb76dd0
commit 23141d82a0
1 changed files with 2 additions and 3 deletions

View File

@ -18,7 +18,6 @@
import os import os
import re import re
from distutils.spawn import find_executable
import subprocess import subprocess
import math import math
import inkex import inkex
@ -173,10 +172,10 @@ class JPEGExport(inkex.EffectExtension):
if os.name == 'nt': if os.name == 'nt':
outfile = outfile.replace("\\","\\\\") outfile = outfile.replace("\\","\\\\")
# set the ImageMagick command to run based on what's installed # set the ImageMagick command to run based on what's installed
if find_executable('magick'): if shutil.which('magick'):
command = "magick \"%sjpinkexp.png\" -sampling-factor 4:4:4 -strip -interlace JPEG -colorspace RGB -quality %s -density %s \"%s\" " % (tmp, self.options.quality, self.options.density, outfile) command = "magick \"%sjpinkexp.png\" -sampling-factor 4:4:4 -strip -interlace JPEG -colorspace RGB -quality %s -density %s \"%s\" " % (tmp, self.options.quality, self.options.density, outfile)
# inkex.utils.debug(command) # inkex.utils.debug(command)
elif find_executable('convert'): elif shutil.which('convert'):
command = "convert \"%sjpinkexp.png\" -sampling-factor 4:4:4 -strip -interlace JPEG -colorspace RGB -quality %s -density %s \"%s\" " % (tmp, self.options.quality, self.options.density, outfile) command = "convert \"%sjpinkexp.png\" -sampling-factor 4:4:4 -strip -interlace JPEG -colorspace RGB -quality %s -density %s \"%s\" " % (tmp, self.options.quality, self.options.density, outfile)
# inkex.utils.debug(command) # inkex.utils.debug(command)
else: else: