Canvas performance degrades when an image has `base64` data in `src`
See original GitHub issueDescribe the bug
Canvas interaction performance degrades when manipulating images that have base64
data in src
To Reproduce
Drag and drop an image into the canvas while logged out. This way, the image is not uploaded to the assets folder, but instead the image data is inserted as base64
into the src
field of the newly created img
.
Result: dragging around the img
becomes noticeably slower
Expected behaviour
Performance stays the same
Screenshots
Profiling canvas interactions on an image with base64 data
Issue Analytics
- State:
- Created a year ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Image not drawing into the canvas using base64 string data
Yes, images produce long base64 strings, but that's fine. I've already shown you how to pass, see the last line in my answer....
Read more >HTML5 canvas - draw image using base 64 encoded png string
HTML5 canvas can be used to draw image from base64 encoded blob using drawImage(). In this case image source will be data:image/png;base64 ......
Read more >Inline Image Previews with Sharp, BlurHash, and Lambda ...
This solves the content reflow problem but at the expense of performance. The user is blocked from seeing any content until the images...
Read more >2.6 Saving Images and Base64 Encoding - YouTube
https://github.com/CodingTrain/Intro-to- Data -APIs-JS Let's add an image from the webcam to our database. For this project, we will be using ...
Read more >Rendering base64 images with react-native-canvas · Issue #23
I'm trying to render a base64 image on the canvas but keep getting an error: 'TypeError: type error'. I'm using the `' component...
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 FreeTop 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
Top GitHub Comments
A bit more digging 🕵️♂️: it looks like the problem is in the parsing of large strings:
is crazy slow, but
seems to be fine.
EDIT: mmh, actually probably the problem is still in the rendering, I’m getting different results now ¯_(ツ)_/¯
As per the related discussion, closing this for now as a
wontfix
since the scope for the issue is only relevant when theimg
itself is dragged, not the container elements.