html-to-image
html-to-image copied to clipboard
Image not downloading as PNG on iPad
Expected Behavior
I'm using toPng to download the React component as a PNG file on this app I built. It works great when I test it from my Windows PC. It should also work the same when I use this app from any browser on the iPad.
Current Behavior
When I click the "Download tweet as an image" button from an iPad device, it tries to download a document that's Zero KB. If I open that in the Downloads folder, it's still a document that's Zero KB instead of a PNG image. It has the randomly generated file name and tries to download a file with the name random-name.png.txt (in Safari) and random-name.png (in Chrome).
I'm not sure why it's appending .txt in Safari.
This behaviour can be tested on this site - https://clydedz.github.io/tweet-to-image/.
Possible Solution
Happy to try out any solutions provided, but I'm not sure what I could do here.
Steps To Reproduce
- Open the site https://clydedz.github.io/tweet-to-image/ on Chrome (and also try Safari) on your iPad device.
- Click on the "Download tweet as an image" button.
- Confirm if an image is downloaded or something else.
Error Message & Stack Trace
<!-- Provide a log message if relevant -->
Code
You could also look at this code block and fork this repository from this commit https://github.com/ClydeDz/tweet-to-image/tree/cff800e073722c7e2fb2888d25e55243f01da131.
Additional Context
Your Environment
- html-to-image: 1.9.0
- OS: iPad 8th gen 15.5
- Browser: Chrome 103.05060.63
👋 @ClydeDz
Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. To help make it easier for us to investigate your issue, please follow the contributing guidelines.
We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here. If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not-stale" to keep this issue open! As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request.
Thanks for being a part of the Antv community! 💪💯
Not stale. Still an issue.
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here. If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not-stale" to keep this issue open! As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request.
Thanks for being a part of the Antv community! 💪💯
bump
bump
https://github.com/ClydeDz/tweet-to-image/blob/main/src/App.tsx#L38
change to pixelRatio: 2,
Any updates?
Do we have any update on this?
My client is facing this same problems on apple devices (tablet-phone), is there a workaround or solution ? or should i change this to html2canvas ?