tsayen / dom-to-image

Generates an image from a DOM node using HTML5 canvas
Other
10.32k stars 1.68k forks source link

Image dataUrl not getting on iPhone / iPad (safari,chrome) #186

Open vishal-px opened 6 years ago

vishal-px commented 6 years ago

I have used this angularjs library Click here This is a reference to dom-to-image library

Its working fine on below-listed OS and browser

Here is a video please see Click to view video

How I can fix the issue on iPhone & iPad, is there any solution?

Syndesi commented 6 years ago

Hi,

could you please post the error log from the console here on GitHub?

vishal-px commented 6 years ago

Thanks for replay @Syndesi .

There is no any error in the console. In the video, I have shown that I not getting Image dataUrl, I am calling the toPng() method.

Syndesi commented 6 years ago

Hi vishal-px,

that's weird. At this point I would assume that there is some kind of problem inside the library itself but I cannot test it because I don't have any Apple products. But I should be able to make a debuged version of the library in order to see where the error occurs. I think it's ready in 2-3 days.

Am 19.02.2018 6:48 vorm. schrieb "vishal-px" notifications@github.com:

Thanks for replay @Syndesi https://github.com/syndesi .

There is no any error in the console log. In the video, I have shown that I not getting Image dataurl, I am calling the toPng() method.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tsayen/dom-to-image/issues/186#issuecomment-366594581, or mute the thread https://github.com/notifications/unsubscribe-auth/AJcea6TTqLJQDzhV2ZUyyDxAKOD0AeCbks5tWQsmgaJpZM4SGVBl .

vishal-px commented 6 years ago

Okay, Thank you, @Syndesi once debugged version is ready then Please inform me.

vishal-px commented 6 years ago

Hi, @Syndesi have you get any solution?

Syndesi commented 6 years ago

Hi,

sry for the delay, I was very busy. But now I have a very basic file which should be able to show where the error occurs. In order to use it, require() the file instead of require('dom-to-image') or replace the file node_modules/dom-to-image/src/dom-to-image.js. The new file just tells you which function is currently running and the last mentioned function should have the error. dom-to-image-debug.zip

vishal-px commented 6 years ago

Hi, @Syndesi Thanks for debug version.

Is there any javascript code or js library that convert "data:image/svg+xml;charset=utf-8," into .svg or .png or .jpeg file ?

Syndesi commented 6 years ago

Hi @vishal-px ,

you can either put the dataURI into an image like this:

<img src="dataURI" />

or you could look at the answers at one of these questions:

Btw, did you manage to create an image on iPhone/iPad?

shime commented 4 years ago

I am having the same issue. Images with data URI are not getting displayed on iPhone and iPad.

qhxin commented 4 years ago

i have the same question. it's about Taint Canvas

andreastepel commented 3 years ago

Anyone got a solution for this? I am running into the same issue.

GCSBOSS commented 1 year ago

I'm facing this in up to date Chrome on Windows.