I'm having trouble in my python script, and I don't understand it :
subprocess.call(['convert', file, '-crop', '80x10+90+980', '+repage', 'test.jpg'])
Returns "invalid argument - -crop"
But if I run this from the command line, it works fine :
convert test.jpg -crop 80x10+90+980 +repage test.jpg
What am I missing here ?
Is there more than one
convert in the system? Try an absolute path to the command you want?
What about using the python image library instead? That seems much more reliable than to call a subprocess (especially for error handling...).
file is a _____builtin_____ class. Overriding it may produce unwanted results. Try using a different variable name.
I've actually tried your code:
>>> import subprocess >>> subprocess.call(['convert', 'capa.jpg', '-crop', '80x10+90+980', '+repage', 'capa2.jpg']) 0 >>>
And it works for me!
So you must have something wrong, somewhere else. Check our assumptions again.