HazAT / badge

Add a badge to your app icon
MIT License
966 stars 87 forks source link

The badge is broken due to librsvg #91

Open changLiuUNSW opened 5 years ago

changLiuUNSW commented 5 years ago

I just installed badge in my new machine today and after run badge command the icon become broken, but it works fine on my old machine.

before

Screen Shot 2019-08-09 at 10 30 48 pm

after

Screen Shot 2019-08-09 at 10 29 12 pm
changLiuUNSW commented 5 years ago

After some research, the issue is caused by pango 1.44.3 which is one of the dependencies of librsvg, because It was working fine with pango 1.42.4. I cannot raise the issue on their github page https://github.com/GNOME/pango, because they disabled it.

changLiuUNSW commented 5 years ago

The workaround for now is to uninstall librsvg and use default graphicsmagick

techinpark commented 5 years ago

@changLiuUNSW same issue. do you find any solution with using librsvg ? I found this link https://gitlab.gnome.org/GNOME/pango/issues

changLiuUNSW commented 5 years ago

@techinpark no solution.

Can we raise the issue to that link?

julianch commented 5 years ago

The workaround for now is to uninstall librsvg and use default graphicsmagick

Could you tell me how to use graphicsmagick? I uninstalled librsvg but I get this error:

INFO [2019-08-29 18:16:36.32]: Start adding badges...
DEBUG [2019-08-29 18:16:36.32]: Trying to load image from shields.io. Timeout: 10s
DEBUG [2019-08-29 18:16:36.32]: URL: https://img.shields.io/badge/1.7-40-blue.png
ERROR [2019-08-29 18:16:36.54]: Error validating image from shields.io. Use --verbose for more info
INFO [2019-08-29 18:16:36.54]: Waiting for 10s and retry to load image from shields.io tries remaining: 5
WARN [2019-08-29 18:16:46.55]: Install RSVG to get better results for shields on top of your icon
WARN [2019-08-29 18:16:46.55]: 
WARN [2019-08-29 18:16:46.55]: Install it using (RSVG):
INFO [2019-08-29 18:16:46.55]: $ brew install librsvg
PatrickDotStar commented 5 years ago

@julianch have you installed graphicsmagick? brew install graphicsmagick

julianch commented 5 years ago

brew install graphicsmagick

@PatrickDotStar Yes, I have graphicsmagick installed and I'm still getting that error.

Gremkow commented 5 years ago

I am experiencing the same error as @julianch . I have graphicsmagick 1.3.33 installed. Sadly this does not seem to be a workaround (or might need some more configuration I am not aware of).

techinpark commented 5 years ago

@julianch how to you run badge? fastlane plugin or standalone ?

Gremkow commented 5 years ago
add_badge(
    dark: true,
    shield: "Version-#{options[:app_version]}-blue",
    glob: "/path/to/png"
)

I use badge inside the fastfile like this.

techinpark commented 5 years ago

@Gremkow (cc @julianch ) In my case, i have same problem like yours.

Solution

  1. Open Terminal and make badge icon

    • badge --shield Version-#{app_version}-blue -- dark
  2. remove add_badge line in fastfile

Gremkow commented 5 years ago

@techinpark Thanks for your advice, when trying to run your command (with a removed whitespace between -- and dark) inside the folder containing the .png, badge does not find any icons. Anyway, we will probably need to get a solution using the fastfile, since running manual commands is not something we want to do in our automation process, if possible. If we find a solution to this which works for us I will update you.

filipef101 commented 5 years ago

using librsvg solved but the badges look blury, any idea to make them less blury?

Gremkow commented 5 years ago

I got it working by

Copying /usr/local/Cellar/pango & /usr/local/Cellar/librsvg from a working machine (older formula versions: librsvg 2.44.14_1, pango 1.42.4_2) to a non working machine.

This might be a work around if you have access to the older version on another machine, but this is not recommend since I don't know what I'm doing with homebrew and you will probably break something and definetly wont be able to update these packages out-of-the-box later on. Simply posting this for people that maybe REALLY need it right now and have access to old files.

wiedem commented 5 years ago

Easiest solution if you're using homebrew: brew switch pango 1.42.4_1

Gremkow commented 5 years ago

Easiest solution if you're using homebrew: brew switch pango 1.42.4_1

This only works if you had it previously installed (and did not get removed via some kind of cleanup), right?

wiedem commented 5 years ago

This only works if you had it previously installed (and did not get removed via some kind of cleanup), right?

Yes.

In case you've already cleaned up version 1.42.4_1, run the following command first: brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/7cf3b63be191cb2ce4cd86f4406915128ec97432/Formula/pango.rb

techinpark commented 5 years ago

@wiedem Thanks for solution!

Here is my solution. open the Terminal and type it commands.

Solution

brew install librsvg 
brew unlink pango  
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/7cf3b63be191cb2ce4cd86f4406915128ec97432/Formula/pango.rb
brew switch pango 1.42.4_1 
adelmojunnior commented 5 years ago

@techinpark The 'alpha' or 'beta' label no more generate.

aitor commented 5 years ago

I've reported this:

And the underlying issue may be connected to the fact that in pango 1.44, they have replaced cairo by harfbuzz for getting glyph extents: https://github.com/harfbuzz/harfbuzz/issues/1892

CMJunghoon commented 4 years ago

Solution brew uninstall librsvg brew uninstall pango

marcosgriselli commented 4 years ago

Is anyone experiencing issues with brew install librsvg? We're using @techinpark and our CI started failing there out of the blue with no visible error.

fruitcoder commented 4 years ago

@marcosgriselli Happened to me a couple of days ago. I used the built in brew install step of Bitrise and some caching which I disabled and replaced everything related to librsvg with a shell script:

brew install librsvg
brew link librsvg

if [ -d "/usr/local/Cellar/pango/1.42.4_2" ]
then
   brew link pango
else
   brew unlink pango
   brew install --build-from-source https://raw.githubusercontent.com/Homebrew/homebrew-core/a8ac7ea5/Formula/pango.rb
fi

I don't know if it helps (I think it's been posted before)

marcosgriselli commented 4 years ago

@fruitcoder thanks! You pushed me in the right direction. I was using the script step but left the set -e line which was probably reporting a false error and failed the step with no reason. Removed it and the installation is working again and the badge looks perfect.

aitor commented 4 years ago

I can confirm that, although the reported issues are still open, pango 1.46.1 fixed the font tracking problem for us and we are using off-the-shelf dependencies configuration again for badge. If the correct behavior is reproduced for more people maybe this issue can be closed.

leonardarnold commented 4 years ago

I came across the issue today and i resolved it with:

brew upgrade librsvg

Thanks @aitor for the effort here

fruitcoder commented 4 years ago

I can confirm that the stable version of pango is working and the issue could be closed

benkane commented 4 years ago

I can also confirm this is no longer an issue with the latest version of librsvg on homebrew. I think this can be closed

hahtml commented 4 years ago

I can confirm this issue has been fixed on my side as well!

phisakel commented 4 years ago

brew install --build-from-source https://raw.githubusercontent.com/Homebrew/homebrew-core/a8ac7ea5/Formula/pango.rb ==> Error: Calling Installation of pango from a GitHub commit URL is disabled! Use 'brew extract pango' to stable tap on GitHub instead.

benkane commented 4 years ago

@phisakel straight up brew install librsvg works now and will give you a working version of pango. No need to manually install a different version of pango after