question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for png images

See original GitHub issue

Sorry if this is too newbie a question, but I’ve had the following problem. I created a blog using the official blog starter, then went to replace profile-pic.jpg with a png image. I replace jpg with png in components/Bio.js, deleted the original image and added my own profile-pic.png. That’s all. Then I got this error:

ERROR in ./components/profile-pic.png
Module build failed: Error: /home/hsribei/usr/src/blog/node_modules/pngquant-bin/vendor/pngquant: error while loading shared libraries: libpng12.so.0: cannot open shared object file: No such file or directory

    at Promise.all.then.arr (/home/hsribei/usr/src/blog/node_modules/execa/index.js:201:11)
    at process._tickDomainCallback (internal/process/next_tick.js:135:7)

Is this something that’s missing in the package.json file? For now I just used a jpg image and it worked, but I would like to know how to make a png file work. Thanks!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

7reactions
hsribeicommented, Mar 25, 2017

Yes. This fixed it for me:

sudo apt-get install libpng-dev
npm rebuild

But I was wondering if this dependency could be installed along with the others.

0reactions
rmcsharrycommented, Apr 23, 2020

I just discovered this bug today and the KEY is making sure that the path to your images folder is correct in the gatsby-config (in the plugins array):

My images are in a strange place in the code I inherited!

    {
      resolve: `gatsby-source-filesystem`,
      options: {
        path: `${__dirname}/content/assets`,
        name: `assets`,
      },
    },
Read more comments on GitHub >

github_iconTop Results From Across the Web

Support PNG Images Transparent Free Download | PNGMart
In this page you can download high-quality free Support PNG Images, pictures, pics, photos in different style, size and resolutions. All Support PNG...
Read more >
Support PNG Transparent Images Free Download | Vector Files
Are you searching for Support png hd images or vector? Choose from 35000+ Support graphic resources and download in the form of PNG,...
Read more >
TinyPNG – Compress WebP, PNG and JPEG images ...
TinyPNG optimizes your WebP, PNG and JPEG images by 50-80% while preserving full ... The result better PNG files with 100% support for...
Read more >
Help PNG Images, Transparent Help Image Download
Discover and download free Help PNG Images on PNGitem. Use these transparent Help image for personal or non-commercial projects.
Read more >
What are PNG files and how do you open them? - Adobe
PNG image files are widely used to create online graphics and logos. ... PNGs, as opposed to GIFs, are a single-image format —...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found