Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

CalledProcessError when calling colorific using subprocess.check_output #21

Open
Antrikshy opened this issue Sep 2, 2014 · 1 comment

Comments

@Antrikshy
Copy link

I can do colorific photo.jpg from Terminal just fine, but when I try this in Python, it fails:

colorific_results.append(subprocess.check_output(['colorific', colorific_param]))

Here, colorific_param is just photo_0.jpg. I get:

subprocess.CalledProcessError: Command '['colorific', 'photo_0.jpg']' returned non-zero exit status 1

Any ideas? I am not adamant on using subprocess, but it just felt easier. I can include colorific in my code if I can figure out how to import it. I just want the functionality that I get when normally using the command and I was unsure on which function to call from my script.

The expected end result is a list or dictionary of output (as strings) from several photos in the current directory.

@larsyencken
Copy link
Contributor

Super belated follow-up:

You've found a bug with the use of images as direct arguments. Originally, colorific was intended to be passed in images one at a time on stdin. The exit behaviour is correct if you call it this way.

>>> import subprocess
>>> subprocess.check_output(['colorific'], input=b'nasa_ares_logo.png')
b'nasa_ares_logo.png\t#0065b9,#bbd6ec,#ff0000\t\n'

Hope that helps.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants