mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-06-05 21:53:15 +03:00
On Windows, do not execute convert.exe without specifying path
Convert.exe is a system tool that converts file systems
This commit is contained in:
parent
91588383e7
commit
09ba5560d8
|
@ -155,7 +155,7 @@ class PillowTestCase(unittest.TestCase):
|
||||||
raise IOError()
|
raise IOError()
|
||||||
|
|
||||||
outfile = self.tempfile("temp.png")
|
outfile = self.tempfile("temp.png")
|
||||||
if command_succeeds(['convert', f, outfile]):
|
if command_succeeds([IMCONVERT, f, outfile]):
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
return Image.open(outfile)
|
return Image.open(outfile)
|
||||||
raise IOError()
|
raise IOError()
|
||||||
|
@ -251,6 +251,14 @@ def netpbm_available():
|
||||||
|
|
||||||
|
|
||||||
def imagemagick_available():
|
def imagemagick_available():
|
||||||
return command_succeeds(['convert', '-version'])
|
return IMCONVERT and command_succeeds([IMCONVERT, '-version'])
|
||||||
|
|
||||||
|
|
||||||
|
if sys.platform == 'win32':
|
||||||
|
IMCONVERT = os.environ.get('MAGICK_HOME', '')
|
||||||
|
if IMCONVERT:
|
||||||
|
IMCONVERT = os.path.join(IMCONVERT, 'convert.exe')
|
||||||
|
else:
|
||||||
|
IMCONVERT = 'convert'
|
||||||
|
|
||||||
# End of file
|
# End of file
|
||||||
|
|
Loading…
Reference in New Issue
Block a user