-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 rendering broken for some image since 3.2.0 #2656
Comments
I have the same problem with .jpg images. Has anyone found a fix for it? |
Same same here. Thought I was going mad. Workaround was to temporarily change images to png. :-( |
Same for me. A PDF with images will show the images in chrome webview, but the images will disappear in safari or preview (mac). They cannot be opened in Adobe Reader at all. Have found that it is only png images that will work, we convert all formats to png with sharp and then give them to react-pdf as a buffer. All other methods seems to create a corrupt pdf file. |
Any progress here? I've found after running jpegs through squoosh, even if the output isn't a smaller file size, the image all of a sudden starts to load, otherwise we see these hard to action logs:
These images are jpg rendered serverside. What is the best way to deal with the seemingly fragile images for react-pdf? Is it just |
Extending the above how do we handle these |
Perhaps coincidental, but when attempting to print said pdf to a xerox machine using a locally embedded font (e.g Montserrat), the printer spits the dummy. It crashes, attempts to print the error message on the page, then swiftly ejects at force. |
Sorry, the above errors are thrown if you have a no height view with a jpeg inside, this was an error on my end, I worked around jpeg images not showing up on mac/adobe reader by just fetching all the image buffers from URL, and using
This only works if your doing this in serverside as I believe sharp is only available, but other client side conversion exist with a similar idea, this is my workaround for right now. |
I have noticed the same, after upgrading the package from 3.0.1, there seems to be inconsistent behavior where the logs are spammed with the error IFDHandler is not defined upon loading images. This hasn't occurred prior to upgrading |
Can confirm. Same here. Jpgs are not rendering in some viewers for example in Envice (Linux), but in Firefox it does. |
Add this "resolutions": { Will fix a lot of issues for everyone. |
Guys, we can try #2646 (comment) as a Temporary Fix. |
I tried updating the dependancies specifically, and even after yarn install its still rendering with blank images on mac/adobe, were you referring to the dependencies part of that comment, or the download and workspaces symlinked approach? @jason-migz (We are using yarn as an FYI) |
@joelybahh for the meantime, use file import in package.json, yes you can use yarn, I am using yarn too. |
@jason-migz, thanks. I tried the files approach but had some issues. We're running from a monorepo, which might be where the added issue is coming from, I'll try that approach again later today. Thank you. I appreciate the effort in providing this workaround |
Describe the bug
We are using react-pdf with 3.1.7. After upgrading
@react-pdf/renderer
to 3.3.8 we noticed image rendering was broken in some cases. We identified that it broke between the version 3.1.7 and 3.2.0.To Reproduce
Steps to reproduce the behavior including code snippet (if applies):
Expected behavior
The second image should also be rendered. When opened in the browser it renders fine.
The text was updated successfully, but these errors were encountered: