I am trying to get image data from a url using parse image module using following but I guess I am not putting response in the right place.
var Image = require(“parse-image”);
var image = new Image();
Parse.Cloud.define(“changePhoto”, function(request, response) {
Parse.Cloud.httpRequest({
success: function(response) {
// The file contents are in response.buffer.
return image.setData(response.buffer, {
success: function() {
response.success("Image is " + image.width() + “x” + image.height() + “.”);
//response.success(image.width());
},
error: function(error) {
// The image data was invalid.
}
})
},
error: function(error) {
// The networking request failed.
}
});
});