mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-10 19:56:47 +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()
|
||||
|
||||
outfile = self.tempfile("temp.png")
|
||||
if command_succeeds(['convert', f, outfile]):
|
||||
if command_succeeds([IMCONVERT, f, outfile]):
|
||||
from PIL import Image
|
||||
return Image.open(outfile)
|
||||
raise IOError()
|
||||
|
@ -251,6 +251,14 @@ def netpbm_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
|
||||
|
|
Loading…
Reference in New Issue
Block a user