-
-
Notifications
You must be signed in to change notification settings - Fork 507
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pbs.convert raise an error #59
Comments
convert is a command tool ImageMagick provides |
Hi Du, unfortunately this is a problem with how pbs and shlex split up arguments. There will be a workaround in v1.0 if I can find it, but in the meantime, you can do this: pbs.convert("-crop", "+0+67", "some.jpg", "crop.jpg") |
Just an update, there will be no workaround in v1.0. It seems that the best way to handle passing arguments to commands is to split them up with the understanding that 1 argument to the pbs command should correspond to 1 argument being passed to the subprocess. I've updated the readme to reflect this. So in other words, this: pbs.convert("-crop +0+67", "some.jpg", "crop.jpg") should always be this: pbs.convert("-crop", "+0+67", "some.jpg", "crop.jpg") Because "-crop" and "+0+67" are separate arguments to the "convert" binary, and using shlex.split() to split up arguments automagically is broken and full of problems. |
pbs.convert("-crop", "+0+67", "some.jpg", "crop.jpg") works. thanks, amoffat. |
here is the command:
raises an error:
I found that
subprocess.Popen(["/usr/bin/convert", "-crop", "+0+67", "some.jpg", "crop.jpg"])
is OK,but
subprocess.Popen(["/usr/bin/convert", "-crop +0+67", "some.jpg", "crop.jpg"])
is NOT.Maybe this is not a bug, maybe it's subprocess's bug.
However, can psb take this situation into account and work around?
Thanks.
Best regards,
Du Yue
The text was updated successfully, but these errors were encountered: