mcollina / heroku-buildpack-imagemagick

An heroku buildpack with the latest version of ImageMagick
45 stars 60 forks source link

Having issue setting this up #8

Closed lgavra closed 10 years ago

lgavra commented 10 years ago

it does not work the build packs show in the vendor and bin lib but calling an imagemagick method keeps failing and it works locally...

mcollina commented 10 years ago

The fact that you put everything in the title is not making this more likely to get answered, you know.

Can you please add your .buildpacks file?

lgavra commented 10 years ago

sorry did not realize that I did that : it just has the bottom two links.

https://github.com/mcollina/heroku-buildpack-imagemagick https://github.com/heroku/heroku-buildpack-nodejs

mcollina commented 10 years ago

Is that file checked in git? I don't see anything special.

What command are you trying to run? What error gives you?

lgavra commented 10 years ago

When saying checked in git what do you mean exactly I did call git add ., commit etc... and then pushed it and the .buildpacks file can be found in my bitbucket repo

I get an ENOENT error while trying to run im.resize. It works locally but I am not sure what is going on in heroku I have these files on heroku available:

-rw------- 1 u6989 6989 16 Mar 30 00:52 Procfile -rw------- 1 u6989 6989 3016 Mar 30 00:52 app.js drwx------ 2 u6989 6989 4096 Mar 30 00:52 bin drwx------ 2 u6989 6989 4096 Mar 30 00:52 config drwx------ 2 u6989 6989 4096 Mar 30 00:52 models drwx------ 12 u6989 6989 4096 Mar 30 00:52 node_modules -rw------- 1 u6989 6989 387 Mar 30 00:52 package.json drwx------ 3 u6989 6989 4096 Mar 30 00:52 public drwx------ 2 u6989 6989 4096 Mar 30 00:52 routes drwx------ 4 u6989 6989 4096 Mar 30 00:52 vendor

and inside of the bin folder I have

-rwx------ 1 u6989 6989 1276 Mar 30 00:52 Magick++-config -rwx------ 1 u6989 6989 1242 Mar 30 00:52 Magick-config -rwx------ 1 u6989 6989 1250 Mar 30 00:52 MagickCore-config -rwx------ 1 u6989 6989 1255 Mar 30 00:52 MagickWand-config -rwx------ 1 u6989 6989 1237 Mar 30 00:52 Wand-config -rwx------ 1 u6989 6989 12959 Mar 30 00:52 animate -rwx------ 1 u6989 6989 13005 Mar 30 00:52 compare -rwx------ 1 u6989 6989 12965 Mar 30 00:52 composite -rwx------ 1 u6989 6989 12959 Mar 30 00:52 conjure -rwx------ 1 u6989 6989 12959 Mar 30 00:52 convert -rwx------ 1 u6989 6989 12959 Mar 30 00:52 display -rwx------ 1 u6989 6989 13008 Mar 30 00:52 identify -rwx------ 1 u6989 6989 12956 Mar 30 00:52 import -rwx------ 1 u6989 6989 12959 Mar 30 00:52 mogrify -rwx------ 1 u6989 6989 12959 Mar 30 00:52 montage -rwx------ 1 u6989 6989 12956 Mar 30 00:52 stream

and inside the vendor

drwx------ 3 u6989 6989 4096 Mar 30 00:52 imagemagick drwx------ 6 u6989 6989 4096 Feb 18 23:44 node

mcollina commented 10 years ago

Actually I did this package to run the command directly.

Can you try issuing heroku run bash and then run mogrify?

lgavra commented 10 years ago

Ok so ran mogrify gives me a bunch of options with this at the end of it...

Am I suppose to do something with these options: -resize geometry resize the image (I see this one to be similar to what I am trying to do)

By default, the image format of `file' is determined by its magic number. To specify a particular image format, precede the filename with an image format name and a colon (i.e. ps:image) or specify the image type as the filename suffix (i.e. image.ps). Specify 'file' as '-' for standard input or output.

mcollina commented 10 years ago

If you can run mogrify than this buildpack is set up ok.

What node module are you using for running imagemagick? I called the executables directly.

lgavra commented 10 years ago

, "imagemagick": "0.1.3"

and my code looks like this:

im.resize({ srcPath: tmp_path, dstPath: targetPathSmall, width: 512, height: 512 }, function(err, stdout, stderr){

mcollina commented 10 years ago

Can you please copy-and-paste the exact error that im.resize is giving you?

lgavra commented 10 years ago

2014-04-01T15:35:37.673131+00:00 app[web.1]: {"photo":{"fieldName":"photo","orig inalFilename":"IMG_20140326_131603.jpg","path":"/tmp/2-1ajnf6c.jpg","headers":{" content-disposition":"form-data; name=\"photo\"; filename=\"IMG_20140326_131603. jpg\"","content-type":"image/png","content-length":"328881","content-transfer-en coding":"binary"},"ws":{"_writableState":{"highWaterMark":16384,"objectMode":fal se,"needDrain":false,"ending":true,"ended":true,"finished":true,"decodeStrings": true,"defaultEncoding":"utf8","length":0,"writing":false,"sync":false,"bufferPro cessing":false,"writecb":null,"writelen":0,"buffer":[],"errorEmitted":false},"wr itable":true,"domain":null,"_events":{"error":[null],"close":[null]},"_maxListen ers":10,"path":"/tmp/2-1ajnf6c.jpg","fd":null,"flags":"w","mode":438,"bytesWritt en":328881,"closed":true},"size":328881,"name":"IMG_20140326_131603.jpg","type": "image/png"}} 2014-04-01T15:35:37.673131+00:00 app[web.1]: Received file: 2014-04-01T15:35:37.694451+00:00 app[web.1]: 2014-04-01T15:35:37.694849+00:00 app[web.1]: events.js:72 2014-04-01T15:35:37.695153+00:00 app[web.1]: throw er; // Unhandled 'err or' event 2014-04-01T15:35:37.695153+00:00 app[web.1]: ^ 2014-04-01T15:35:37.696901+00:00 app[web.1]: Error: spawn ENOENT 2014-04-01T15:35:37.696901+00:00 app[web.1]: at errnoException (child_proces s.js:988:11) 2014-04-01T15:35:37.696901+00:00 app[web.1]: at Process.ChildProcess._handle .onexit (child_process.js:779:34)

The top is the image being sent I have a console.lo on it including Received file: but it crashes as soon as im.resize is called with that error.

mcollina commented 10 years ago

Can you please try with the gm module https://github.com/aheckmann/gm? As the author of the imagemagick module reports, that is unmaintained.

lgavra commented 10 years ago

hey thanks, I actually forgot to take it out completely had a second call pointing to the wrong path (my C:/) Thanks for your help and just getting a normal error: 2014-04-01T16:40:03.903173+00:00 app[web.1]: Error: Request aborted 2014-04-01T16:40:03.903173+00:00 app[web.1]: at IncomingMessage.onReqAborted (/app/node_modules/express/node_modules/connect/node_modules/multiparty/index.j s:131:17) 2014-04-01T16:40:03.903173+00:00 app[web.1]: at IncomingMessage.EventEmitter .emit (events.js:92:17) 2014-04-01T16:40:03.903173+00:00 app[web.1]: at abortIncoming (http.js:1911: 11) 2014-04-01T16:40:03.903173+00:00 app[web.1]: at Socket.EventEmitter.emit (ev ents.js:117:20) 2014-04-01T16:40:03.903173+00:00 app[web.1]: at Socket.socket.onend (http.js :2010:7) 2014-04-01T16:40:03.903173+00:00 app[web.1]: at _stream_readable.js:920:16 2014-04-01T16:40:03.903173+00:00 app[web.1]: at Socket.g (events.js:180:16) 2014-04-01T16:40:03.903173+00:00 app[web.1]: at process._tickCallback (node. js:415:13)

which I am assuming has to do with trying to add it to heroku and nothing to do with imagemagick right

mcollina commented 10 years ago

I think so :)