react cant read the image json url content - reactjs

I have local json data's and I'm going to map through them
as a problem react cant read image url while mapping it
but when I import the images as something like logo or etc... it shows the image

use require to import pictures
<img src={require(cat.img)}/>

you can map images without importing
you just have to put images in public folder

Related

Images not showing in React where the src is correct

Hey I have a weird issue in react images. Some images are not showing and some are showing.
This is my simple implementation:
<img src={item?.media?.url} />
and when I check the console and then copy the src, the image opens normally. So the url isn't the problem
Looks like you're trying to hotlink an Instagram image.
You can try downloading the image and then displaying it, or you can just embed the Instagram post
It seems your URL is broken, cause the way your using it is correct, make sure by clicking on the link, a new tab should open showing the actual image
And make sure the extension of the image is being added, cause on the image that you shared, there is no valid image extension in the URL (.png, .jpg, etc..)

React-PDF/Rendered doesn't render image URL

I use react-pdf/renderer in my app and managed to create PDF file with some images included. Images located locally (the ones imported via import from 'imagePath') are loaded normally, but when I pass base64 encoded string, image is missing in PDF preview. As per doc, built in <Image /> component can receive url but in my case it doesn't work. Anyone faced similar issues?

Importing images to react as they generate

I am generating images sequentially that I want to display in my react app. Currently I am importing the images, as shown below, but I am getting an import error, since the later images don't exist yet.
import image1 from '../output/img1.jpg';
import image2 from '../output/img2.jpg';
I have a solution which isn't very elegant: I could have placeholder images, I could download the generated images somewhere else, wait for those generated images appear elsewhere, download those generated images to the React app, and then display the downloaded image once my app sees that the image exists in both places.
Is there a better solution for this?

How to execute face detection with non-local files in React JS app?

Right now I'm working on a movie browser app which displays images of the acting cast. The images themselves are loaded from an external source via a URL link. I'm wondering how I can pass those images through a face detector, and display the cropped face within an img tag?
The image tag itself requests a src, but I intend to use the image after it has been passed through the face detector, meaning it won't be coming from an external source. I don't think I can pass an image matrix into img directly, so how could I store the image within my React app so it can be passed into img?
This app will be deployed on GitHub Pages or Netlify for public viewing, so I won't be able to modify the source files presumably. I'm assuming a server will come into play but how?

React native how to save image in application?

I want to save images from camera roll internally in my app.
I've been using react-native-image-crop-picker to import the image's base64 data and saving it with AsyncStorage.
The problem is when it comes to render Images using base64 data, it's extremely slow.
I would like to save the images and have their URIs in order to render them faster.
Refer this link How to get absolute path of a file in React-native
This Link will help you in Implementation Code Sample
Once you get the absolute path of the file rn-fetch-blob package will help you store it your file system checkout this link File system
I hope this helps, do comment if any doubts !

Resources