node.jsherokugraphicsmagick

Is there a way to install GraphicsMagick on Heroku?


I want to use gm package to generate thumbnail image (50x50) but I must install graphicsmagick in my Heroku server. So I googled it ,but haven't got a solution.


Solution

  • 2021 Update:

    I managed to install GraphicsMagick on my NodeJS Heroku project.

    You just have to add heroku-buildpack-graphicsmagick into your project.

    Right now there are a lot of methods, but the fastest one is:

    1. Go to your Heroku Dashboard > Your Project > Settings tab

    2. Scroll down to your Buildpacks section.

    3. Add the buildpack .git link:

      https://github.com/xerpa/heroku-buildpack-graphicsmagick.git

    4. Save and deploy your app again. Then it will be instaled.

    Here's how it should look: Heroku

    Now it should work.

    If you're interested in my case: I was trying to add a library to create barcodes into a pdf. For that I used a library called barcode and pdfkit. Then in order for the barcode library to work, I had to have a working installation of GraphicsMagick. Then I discovered that I had to install this 'gm' dependency into my Heroku project.

    Also, this is how it looks when deploying your project:

    GraphicsMagick app detected

    + install GraphicsMagick-1.3.19