Skip to content

Instantly share code, notes, and snippets.

@meltingice
Created May 10, 2013 22:53
Show Gist options
  • Save meltingice/5558028 to your computer and use it in GitHub Desktop.
Save meltingice/5558028 to your computer and use it in GitHub Desktop.
<head>
<script type="text/javascript">
var ready = false;
var caman = Caman('#example', 'EdielOficial.JPG', function () {
this.render(function () {
ready = true;
//this.save('png'); // shows a download file prompt
});
});
document.findElementById('save').onclick = function () {
if (!ready) return false;
caman.save();
};
</script>
</head>
<body>
<div id="Content">
<img
id="example"
src="EdielOficial.JPG"
>
<a id="save">Salvar</a>
@edielrangel
Copy link

Thank you for your help. But the code does not return the desired value. What I want to do is save the image after changed. To this end user would click a button "SAVE" and the image should be saved in an address on the server. Its you help me with this code?
grateful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment