Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image component can't render JPG image #2622

Closed
AngelDev0329 opened this issue Feb 7, 2024 · 5 comments · Fixed by #2687
Closed

Image component can't render JPG image #2622

AngelDev0329 opened this issue Feb 7, 2024 · 5 comments · Fixed by #2687

Comments

@AngelDev0329
Copy link

I want to put jpg image on Image component but it doesn't show it.
<Image
src="https://d3amu2bzl0th70.cloudfront.net/tickets/test/leaves-nature-macro-plants-wallpaper_1698738909625.jpg"
style={{ height: 100, width: 300 }}
/>

This is my code. How can I fix this?

@krzysztof-stanislawski
Copy link

are you getting this error?
JPG is not a constructor

@diegomura
Copy link
Owner

We will need more details about error

@arvind-14
Copy link

solution 1:Ensure that the image URL you provided is correct and accessible. You can open the URL in a web browser to confirm that the image is loading.
solution 2: You can use simple tag in JSX
<img
src="https://d3amu2bzl0th70.cloudfront.net/tickets/test/leaves-nature-macro-plants-wallpaper_1698738909625.jpg"
style={{ height: 100, width: 300 }}
alt="Nature"
/>

@Elvinra
Copy link

Elvinra commented Feb 13, 2024

Hello,

I have the same problem.

I'm currently building a PDF with Node 18 (Typescript)

But after some testing, the JPEG is here in the PDF because if i'm trying to open it on Microsoft Edge, it is displayed correctly, but they are no JPEG with Okular (KDE)

With the same file as PNG, they are no problem.

EDIT:

On IPhone they are no JPEG

@renchap
Copy link
Contributor

renchap commented Mar 2, 2024

The error is a regression from #2591, it no longer defined this.bits.

I am not sure how to get this information from jay-peg, but it should be an easy fix for @diegomura

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants