wPaint icon indicating copy to clipboard operation
wPaint copied to clipboard

Error with external background DOM Exception 18

Open OscarDeDios opened this issue 12 years ago • 2 comments

Hi, thank you for your wonderful plugin.

I want to paint over images what have URL outside my web.

I use: $("#wPaint").wPaint({ imageBg: url, // of another domain });

It works I can paint over the image, but when I try to capture the image: var imageData = $("#wPaint").wPaint("image");

I have the error: Uncaught Error: SecurityError: DOM Exception 18 wPaint.js:644

It seems some related with cross domain because the URL is not in my server.

Is there any way to solve this?

I do the same from a chrome extension and it works, but from a normal web I can't.

Thank you.

Oscar.

OscarDeDios avatar Jun 06 '13 16:06 OscarDeDios

I've encountered this issue before and have not been able to find a solution for it. What I do in this situation is just upload the image to my own server and then set it. On Jun 6, 2013 11:53 PM, "Oscar de Dios" [email protected] wrote:

Hi, thank you for your wonderful plugin.

I want to paint over images what have URL outside my web.

I use: $("#wPaint").wPaint({ imageBg: url, // of another domain });

It works I can paint over the image, but when I try to capture the image: var imageData = $("#wPaint").wPaint("image");

I have the error: Uncaught Error: SecurityError: DOM Exception 18 wPaint.js:644

It seems some related with cross domain because the URL is not in my server.

Is there any way to solve this?

I do the same from a chrome extension and it works, but from a normal web I can't.

Thank you.

Oscar.

— Reply to this email directly or view it on GitHubhttps://github.com/websanova/wPaint/issues/37 .

websanova avatar Jun 07 '13 01:06 websanova

Hi. I found that to avoid this error message it exists the parameter "crossorigin"

I tried to put the line

myImage.crossorigin = "anonymous"

In setBgImage function.

And this error desappeared.... but it appears another one! :( Something related with crossorigin exception.

Finally I surrendered and now I upload the image before paint it. If someone find a solution share it here please!.

If you want to see my use of the plugin visit http://noteboardapp.com or the chrome extension https://chrome.google.com/webstore/detail/note-board/goficmpcgcnombioohjcgdhbaloknabb

I'm going to add a link to your web in my "powered by" section (now I only have tinymce plugin editor).

Regards. Oscar.

OscarDeDios avatar Jun 13 '13 13:06 OscarDeDios