devgeeks / Canvas2ImagePlugin

PhoneGap / Cordova plugin for iOS to save the contents of an HTML canvas to the device's Photo Library
211 stars 218 forks source link

Add jpeg support #12

Open bartburkhardt opened 11 years ago

bartburkhardt commented 11 years ago

Hi, I needed jpeg support so I changed this line, maybe make this available as a setting?

//var imageData = canvas.toDataURL().replace(/data:image\/png;base64,/,''); var imageData = canvas.toDataURL("image/jpeg", 1.0).replace(/data:image\/jpeg;base64,/,'');

devgeeks commented 11 years ago

That's a great idea... I might try and get on that this weekend.

devgeeks commented 11 years ago

Update: still haven't gotten around to this... still want to though. Trying to find time to work on this plugin.

SansWord commented 10 years ago

I've open a pull request to extends a api to save data string as image into library. It can also save dataURL of jpg, too.

michalek94 commented 8 years ago

var imageData = canvas.toDataURL("image/jpeg", 1.0).replace(/data:image\/jpeg;base64,/,'');

is this working ?