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

CLI raster badges are broken #1788

Closed
paulmelnikow opened this issue Jul 19, 2018 · 6 comments
Closed

CLI raster badges are broken #1788

paulmelnikow opened this issue Jul 19, 2018 · 6 comments
Labels
bug Bugs in badges and the frontend

Comments

@paulmelnikow
Copy link
Member

As observed at https://github.com/badges/shields/pull/1774/files#r203522813, the CLI isn't generating raster badges correctly.

node lib/badge-cli.js '' '' '#bada55' .png > favicon.png

Observed output:
favicon

Expected output:

@paulmelnikow paulmelnikow added the bug Bugs in badges and the frontend label Jul 19, 2018
@platan platan self-assigned this Aug 20, 2018
@platan
Copy link
Member

platan commented Aug 20, 2018

# prepare a test
cat test.sh 
node lib/badge-cli.js '' '' '#bada55' .svg > favicon-tested.svg
grep 'width="22"' favicon-tested.svg

# find a bad commit
git bisect start HEAD 438e47adfb74e9a775e3fed7a5547959f343c009
git bisect run ./test.sh

# result
b216bcc17e667a2fb09bede7be0d1c67e731d767 is the first bad commit

the bad commit -> b216bcc

@platan platan removed their assignment Aug 20, 2018
@platan
Copy link
Member

platan commented Aug 20, 2018

But:

node lib/badge-cli.js '' '' '#bada55' .png > favicon.png

gives me:

@paulmelnikow
Copy link
Member Author

paulmelnikow commented Jun 25, 2019

Seems like this may be a "wontfix," given discussion in #3587 and #3112.

@paulmelnikow
Copy link
Member Author

As discussed at #3644 (comment) it seems these work fine on some systems.

I've just upgraded imagemagick, and this is what I'm seeing now:

node lib/badge-cli.js build passed :green .png > mybadge.png

mybadge

The summary of other discussions we've had is that:

  • We want this to work more reliably.
  • It'll be through an optionalDependency to keep the gh-badges footprint smaller.
  • We can switch from gm / imagemagick to Puppeteer using the more modern rasterization library convert-svg-to-png – that's the one that's being used in svg-to-image-proxy.

@brettz9
Copy link

brettz9 commented Nov 24, 2019

Whenever the change might be made, could the functionality be added on the programmatic side as well?

@paulmelnikow
Copy link
Member Author

This functionality is being removed in #4756, so closing this.

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

3 participants