Open yadavpeoplelink opened 8 years ago
I use this in the plugin options:
plugins: {
...
save:{
callback: function(){
this.darkroom.selfDestroy();
editorSaveCallback(this.darkroom.sourceCanvas.toDataURL());
}
}
}
The elaborated image in base64 is passed to my editorSaveCallback
function, where I POST
it via AJAX to a php script and do something similar to this:
$file = fopen($fileName, "wb");
$data = explode(',', $_POST['imagedata']);
fwrite($file, base64_decode($data[1]));
fclose($file);
This converts the image back to binary and writes it to a file, the format is the same of the image you called Darkroom on.
Can we save cropped image canvas data as a image file??