0

I'm trying to convert some kind of images to jpg and save as a parse file.

Using the parse-image module works for GIF and PNG files, but I need to convert some BMP files too and this module does not work for .bmp files.

Is there anyway for me to do this image conversion on ParseCloud?

This is the code I used for parse-image:

    Parse.Cloud.httpRequest({ url: url }).then(function(response) {
      // Create an Image from the data.
      var image = new Image();
      return image.setData(response.buffer);

    },function(error) { 
        console.log("Image not generated " + error.text);
    }).then(function(image) {
      // Format the image to a JPEG.
      return image.setFormat("JPEG");        
    },function(error) { 
        console.log("Image set format failed");
    })

Tks,

user2494863
  • 451
  • 7
  • 17

0 Answers0