Thank you! Your feedback has been delivered
Thank you! Your feedback has been sent

Use GraphicksMagick package with Meteor

I am having the issue described on Github here: https://github.com/royletron/graphicsmagick-meteor/issues/1

I'm not sure if this is a git tag issue, or a dependency issue, or both, but I would just like to get a "Hello World" (e.g. an image resize) going with Meteor and GraphicksMagick.

Here's what I've done:

  1. meteor create gmtest && cd gmtest

  2. mrt add GraphicsMagick

  3. Then I get this error in the terminal:

    ✓ GraphicsMagick tag: https://github.com/royletron/graphicsmagick-meteor.git#v0.0.4

    /usr/local/lib/node_modules/meteorite/lib/sources/git.js:152 hrow "There was a problem checking out " + self.checkoutType + ": " + (self.co ^ There was a problem checking out tag: v0.0.4

That's as far as I can get. I would just use the code example from the site—

On the server side:

Meteor.methods({
    resize: function( fileName ){
        var __dirname = path.resolve('.');
        gm( __dirname + '/public/ + fileName ).resize(240, 240)
        .write(__dirname+'/public/resized/ + fileName, function (err) {
                          if (!err) console.log('Image resized via GM');
                     });
        }
   });

On the client side

Meteor.call('resize', "foo.jpg" );

Does anyone know how to deal with this error? Others have run into the same git error message with other Meteorite packages, e.g., https://github.com/oortcloud/meteorite/issues/81 —but I didn't quite know what to make of that thread.

User Gravatar

web559

Posted Dec 11 2013 19:46 UTC

$25


  • meteor
  • 1440 Views

4 Replies


This is an issue with the package itself, the author forgot to add the tag (v0.0.4). You can resolve this two ways.

For both please open you smart.json file and add:

For the previous tag (v0.0.3)

{
  "packages": {
    "GraphicsMagick": {
        "git":"https://github.com/royletron/graphicsmagick-meteor",
        "tag": "v0.0.3"
        }
  }
}

To just have the most current version of the code via the master branch

{
  "packages": {
    "GraphicsMagick": {
        "git":"https://github.com/royletron/graphicsmagick-meteor",
        "branch": "master"
        }
  }
}

EDIT: I have added my comments to the existing issue on the Github.

User Gravatar

Conner

Posted Dec 12 2013 5:17 UTC

{This is a reply to @Conner. I don't see a way to add comments.}

Thanks. I now have the package installed successfully, but I am getting the path is not defined error again, described in the GH issue. I get the error when invoking path (on the server side, so the error is in the command line). Do you have any suggestions?

I used the master branch of the GraphicsMagick package, because it contains an update that was supposed to fix the path is not defined error, but I am still getting that error.


Just a note that I had to run mrt list for it to download the new package after editing smart.json. When I did, I got the success message below, showing the packages and npm dependencies installing correctly, including path.

Stand back while Meteorite does its thing
✓ GraphicsMagick
    branch: https://github.com/royletron/graphicsmagick-meteor#master
Done installing smart packages
Ok, everything's ready. Here comes Meteor!
GraphicsMagick: updating npm dependencies -- gm, path...
User Gravatar

web559

Posted Dec 12 2013 6:54 UTC

{Reply to your comment 'answer'}

Oh ha yeah, so simple enough. You are using Meteor 0.6+ right? Yeah, this package is not exporting any variables. There is no global helper called path or gm, export was added in 0.6, so this package does absolutely not a thing for you right now.

EDIT: This turned out to be an easy fix and I have already pushed a patch that resolved the issue on my box.

User Gravatar

Conner

Posted Dec 12 2013 7:54 UTC

{Reply to Connor}

Great catch. That error is now gone, but I get this error when trying to run the resize method containing path.resolve('.'):

Exception while invoking method 'resize' TypeError: Object #<Object> has no method 'cwd' 
at Object.exports.resolve ({/path/to/}path.js:209:21)

I am on a Mac, using the latest Meteor (0.6.6.3).

User Gravatar

web559

Posted Dec 12 2013 18:38 UTC

Add a reply

By posting a reply on CodersClan you agree to our Terms & Conditions