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

Could not execute GraphicsMagick/ImageMagick #16

Open
taileshrbamankar opened this issue Oct 17, 2016 · 9 comments
Open

Could not execute GraphicsMagick/ImageMagick #16

taileshrbamankar opened this issue Oct 17, 2016 · 9 comments

Comments

@taileshrbamankar
Copy link

I getting this error :

Error generating response. ParseError {
code: 141,
message: [Error: Could not execute GraphicsMagick/ImageMagick: identify "-ping" "-format" "%wx%h" "-" this most likely means the gm/convert binaries can't be found] }

I deployed my application of aws elasticbeanstalk.

Below are cloud code to Generate thumbnail using aws photo url and save thumbnail to parse file

var Image = require("parse-image");
var request = require('request');

Parse.Cloud.define("TestImageCropFuntion", function(request, response) {
var fs = require('fs'),
im = require('imagemagick');
var albumobjct = request.params.imageurl;
// response.success(albumobjct);
var image_url = albumobjct._url;
var image_name = albumobjct.name;
Parse.Cloud.httpRequest({
url: image_url
}).then(function(response) {
var image = new Image();
return image.setData(response.buffer);
}).then(function(image) {
/Crop the image to the smaller of width or height./
var size = Math.min(image.width(), image.height());
return image.crop({
left: (image.width() - size) / 2,
top: (image.height() - size) / 2,
width: size,
height: size
});
}).then(function(image) {
/Resize the image to 64x64./
return image.scale({
width: 500, //250
height: 500 //250
});
}).then(function(image) {
/Make sure it's a JPEG to save disk space and bandwidth./
return image.setFormat("JPEG");
}).then(function(image) {
/* Get the image data in a Buffer.
/
return image.data();
}).then(function(buffer) {
/_Save the image into a new file.*/
var base64 = buffer.toString("base64");
var cropped = new Parse.File(image_name, {
base64: base64
});
return cropped.save({useMasterKey: true});
}).then(function(cropped) {
response.success(cropped._url);
}).then(function(result) {
console.log("result final then" + result);
}, function(error) {
response.error(error);
});
});

@junal
Copy link

junal commented Nov 25, 2016

I'm having exact same issue. @flovilmart Any idea?

@flovilmart
Copy link
Owner

I'm not sure as it's on elastic beanstalk. you should probably look at the error and see what's the issue there.

@junal
Copy link

junal commented Nov 25, 2016

@flovilmart Error is same as above. Here's my full error.

2016-11-25T16:20:35.661Z - Error generating response. ParseError {
code: 141,
message:
Error: Could not execute GraphicsMagick/ImageMagick: identify "-ping" "-format" "%wx%h" "-" this most likely means the gm/convert binaries can't be found
at ChildProcess. (/root/pgx/node_modules/gm/lib/command.js:299:14)
at emitOne (events.js:96:13)
at ChildProcess.emit (events.js:188:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:213:12)
at onErrorNT (internal/child_process.js:359:16)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickDomainCallback (internal/process/next_tick.js:122:9) }

@flovilmart
Copy link
Owner

And as you can see it's generated by the gm module, not parse-image.

@junal
Copy link

junal commented Nov 25, 2016

I have no clue about GM. Tried uninstalling and re-installing. Same result.

@flovilmart
Copy link
Owner

What I'm trying to say is that the problem lies into the gm module, not this module. I'm not sure how this is different on elastic beanstalk, or if this package can be deployed there.

@junal
Copy link

junal commented Nov 25, 2016

@taileshrbamankar did you find any solution?

@JongSeok-Kim
Copy link

I'm having exact same issue.

@anoopmundathan
Copy link

Same issue for me as well

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

5 participants