Skip to content
This repository has been archived by the owner on Jan 5, 2021. It is now read-only.

loading image data from URL with parse-image and Parse.Cloud.httpRequest #2

Closed
sraveh opened this issue Feb 3, 2016 · 2 comments
Closed

Comments

@sraveh
Copy link

sraveh commented Feb 3, 2016

I'm trying to use parse-image with the new parse server.
My code in parse cloud load an image from a URL and uses the parse image module library to manipulate it.

return Parse.Cloud.httpRequest({
url: url
}).then(function (response) {
var image = new Image();
return image.setData(response.buffer);
});

The URL I've been using for testing is: http://lorempixel.com/500/500/cats/.
This all work nicely on Parse.com when trying the same code with the local parse server and parse image I notice few things:

  1. the response does not contain buffer anymore. it is just the raw data.
  2. when passing the data to parse-image using image.setData(response); I get an error from gm

Appreciate any help

Thanks,
Simon

@flovilmart
Copy link
Owner

HI simon, he response.buffer missing is actually a bug from the parse-server code.

On 3 févr. 2016 01:00 -0500, Simonnotifications@github.com, wrote:

I'm trying to use parse-image with the new parse server.
My code in parse cloud load an image from a URL and uses the parse image module library to manipulate it.

return Parse.Cloud.httpRequest({
url: url
}).then(function (response) {
var image = new Image();
return image.setData(response.buffer);
});

The URL I've been using for testing is:http://lorempixel.com/500/500/cats/.
This all work nicely on Parse.com when trying the same code with the local parse server and parse image I notice few things:

  1. the response does not contain buffer anymore. it is just the raw data.
  2. when passing the data to parse-image using image.setData(response); I get an error from gm

Appreciate any help

Thanks,
Simon


Reply to this email directly orview it on GitHub(#2).

@flovilmart
Copy link
Owner

@sraveh the issue should be fixed on the master branch of parse-server. Let me know if the issue persists.

@sraveh sraveh closed this as completed Feb 10, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants