0

When I use the gm.toBuffer, the image is not manipulated at all. The only exception is that if I pass in the image type, it will change, but the image is not getting resized. It works if I spit out the file to the disk, but in this case I'd like to write it directly into the database.

I've also tried installing imagemagick and doing the subclass, but I get the same result. I am running Windows 7.

Here is what my logic looks like:

var gm = require('gm');

gm(req.files.file.path)
.resize(256, 256)
.toBuffer(function(err, data) {
  if (err) { throw err; }

  Users.updateById(uid, {$set: {
    photo256: data
  }});
});
Eric
  • 409
  • 3
  • 9

1 Answers1

0

The problem ended up being in the getter of the API. The logic above worked perfectly, it was the getter that was always returning the original image. How embarassing.

Eric
  • 409
  • 3
  • 9