question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to get image drawn in canvas (The operation is insecure)

See original GitHub issue

Hi i want little bit optimization my images and i use for this canvas,

Currently i have this code

const context = canvas.getContext('2d', { alpha: false });
 const image = new CanvasImage(canvas)

image.src = 'https://res.cloudinary.com/pozna/image/upload/v1564828195/fpztmajxhmphfpaechfa.jpg';
canvas.width = width;
canvas.height = 600;

image.addEventListener('load', () => {
context.drawImage(image, 0, 0, 500, 500).then(() => {
// here i want get image url or other data
 });
});

Can anyone help me? 😃

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:22 (4 by maintainers)

github_iconTop GitHub Comments

8reactions
iddancommented, Sep 13, 2019

This is a general HTML Canvas issue. Check this discussion: https://stackoverflow.com/questions/25753754/canvas-todataurl-security-error-the-operation-is-insecure. Closing as it is not relevant only for this project.

6reactions
aravikanticommented, Aug 10, 2019

I am facing the same issue when I am upgrading react native to 0.59.8. and using react-native-webview 6.1.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

canvas.toDataURL() Security Error The operation is insecure
Drawing video data on the canvas sets the origin-clean flag to false, which stops you from getting the image data in any way....
Read more >
Why does canvas.toDataURL() throws a security exception?
Tainted canvas is not considered secure. Trials to retrieve image data from the canvas will lead to failure indicated by security exceptions.
Read more >
canvas.toBlob(function(blob)) is giving SecurityError
Tainted canvas happens, when you load some CORS insecure third-party (cross-domain) image into your map (canvas).
Read more >
SecurityError: The operation is insecure in canvas.toDataURL
HTML : SecurityError: The operation is insecure in canvas.toDataURL [ Beautify Your Computer : https://www.hows.tech/p/recommended.html ] ...
Read more >
canvas todataurl security error
Canvas drawing pictures, because of the security of the browser, if you use the canvas drawing process, using the image resources in Outland,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found