Skip to content
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

Provides an empty png instead of an error when imagemagick is not found #914

Closed
paulmelnikow opened this issue Mar 28, 2017 · 1 comment
Closed
Labels
bug Bugs in badges and the frontend

Comments

@paulmelnikow
Copy link
Member

paulmelnikow commented Mar 28, 2017

Generating e.g. .png badges from the CLI or API will fail silently when imagemagick is not installed. An empty .png is emitted.

Expected behavior from the CLI: an error return status and an error message. From the API: an error message in the response, a 503 status code, and a log message.

This was a gotcha for me, and would be for other people getting set up as well: see #883.

The issue is upstream issue in gm. When spawning convert, this line invokes the callback immediately, before the subprocess has a chance to emit the error.

Reported at aheckmann/gm#548 aheckmann/gm#256 but there hasn't been a fix. Not much active maintenance on that project, unfortunately.

Some possible resolutions:

  1. Fix upstream (seems best)
  2. Raise an error when nothing gets emitted (seems a serviceable hack)
  3. Run a quick self-test when the server starts up (seems worst)
@paulmelnikow paulmelnikow added the bug Bugs in badges and the frontend label Mar 28, 2017
@paulmelnikow
Copy link
Member Author

Opened a patch upstream aheckmann/gm#647, though it may not be merged timely.

paulmelnikow referenced this issue Apr 6, 2017
Given the chunks coming from imagemagick are getting stored memory and
then tucked into a cache, this function could as easily return a buffer
via callback. Streaming is just making it more complex. (And trickier to
test!)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bugs in badges and the frontend
Projects
None yet
Development

No branches or pull requests

1 participant