So I have some images and I could sucessfuly apply effects to them by using the CamanJS plugin. But now I want to save these altered images and replace them with the original one.
The documentation (link) Provides information on saving images. but it is seen as a download prompt. I want the images to be saved at the server without a prompt and on the click of the "save" button.
The documentation also says something about base64 encoding which I dont understand. Could my problem be solved? thanks!.
CamanJS has a built-in function that helps you get the Base64 representation of the image. You can send that to the server via Ajax, decode the base64 string, and save it as a normal image.
Caman("#my-image", function () {
this.brightness(10);
this.render(function () {
var image = this.toBase64();
saveToServer(image); // your ajax function
});
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With