Not clear how to include images in my application
See original GitHub issueThis is probably an RTM moment for me with Electron in general, but it’s not obvious how to set this up so that images can be included in the stylesheets (via background-image
) or via img
tags in the react markup: trying to link to an image throws a missing loader error because the url
is parsed as a require. How could I go about getting images to show up in a project based on this boilerplate? Thanks,
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:44 (11 by maintainers)
Top Results From Across the Web
Why am not getting clear images while working in Android ...
I am creating my app in android studio and I am using an image, if no past order present. I have imported images...
Read more >3 Easy Ways to Make Blurry Image Clear and Sharp
To make a blurry image sharp and clear, upload it to letsenhance.io, and click Start processing. That's the simplest answer.
Read more >Formatting your images for display on the web
Images added to galleries display best if all images have a similar shape. For example, use all landscape images (wider than they are...
Read more >Preventing Blurry Pictures: The Keys to Clear Images
Nothing is more frustrating than blurry pictures. While you can try tinkering in a photo editing program, the best strategy is to start...
Read more >12 Best Apps To Make Pictures Clear in 2022 (Fix Blurry Photos)
After you open a photo in the app, you can select a “look” (aka filter) to apply to your image. Or you can...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@amilajack Apologies, I shouldn’t have brought up the loaders at all because my question was not CSS-specific; I can figure out how to work around the loaders on my own. My question is, where I would put an image asset within the boilerplate so that it could be loaded through a regular image tag. I’m confused about how Electron actually locates static assets, should I want to load a resource as a normal img tag
src
as opposed to through part of the webpack bundle.For a more concrete question, where would I put an image file and how would I formulate my
src
attribute such that adding animg
tag to theCounter
component would display that image?Thank you for any assistance you might be able to offer!
@amilajack figured out the issue, the css is using a relative path to the file while the img tag is looking in the top level img folder.
if anyone else has this problem i had to do: