Calling ImageMagick's convert

cmr.Pent at cmr.Pent at
Mon Dec 22 09:15:01 CET 2008

Hello group!

I'm a Python beginner. I'm trying to call ImageMagick's convert
program from my code.
My OS is Debian testing, and my version of Python is 2.5.

I've just stumbled upon a problem:

(1)'convert in.png -resize 640x480 out.png', shell =

works, but none of the following does:

(2)'convert in.png -resize 640x480 out.png')
(3)['convert', 'in.png', '-resize 640x480',
(4)['convert', 'in.png', '-resize 640x480',
'out.png'], shell = True)

In these cases, convert program says 'unrecognized option -resize
At the same time,['ls', '-l'])

works as expected.

I'd like to use variant (3), as it seems the most handy. I don't
understand why is shell = True required in case of convert. Is it a
bug in Python, in ImageMagick, or am I missing something very basic
Any hint appreciated.


More information about the Python-list mailing list