Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript Canvas: base64 back to file after resizing&resampling? [duplicate]

Possible Duplicate:
Convert Data URI to File then append to FormData

Is it possible to save rendered canvas back to a file in Google Chrome?

I have tried this:

canvas.getAsFile('foo.jpg','image/jpeg')

Doesn't work.

This works only in Firefox:

canvas.mozGetAsFile('foo.jpg')

Of course I can and probably will just send raw base64 encoded string to server and decode it there.

But if it's possible to do it on client-side, i would prefer doing it there.

like image 279
Somebody Avatar asked Nov 14 '22 20:11

Somebody


1 Answers

Maybe this Stack Overflow Question and Answer might help you.

like image 147
Sani Singh Huttunen Avatar answered Nov 16 '22 22:11

Sani Singh Huttunen