sylvaingi / meteor-imagemagick

MIT License
23 stars 9 forks source link

No callback from resize/crop #3

Open ghost opened 10 years ago

ghost commented 10 years ago

Hi there, I am resizing/cropping in collectionFS fileHandler, and experiencing an issue when I resize/crop a file, it has no callback fired. Any idea?

sylvaingi commented 10 years ago

It was a bug in the docs, there's no callback invoked since this lib has a synchronous API. Whenever crop() returns, that means that the operation completed.

ghost commented 10 years ago

Thank you. So is there I way I can use the output of the new cropped file? Not the one saved as file. I need the buffer actually. I tris to get the return value from crop() but looks like it is not an image buffer. Or I missed something?

sylvaingi commented 10 years ago

You need to read the file Imagemagick written with fs.readFile.

Bottom line is, this lib is just calling Imagemagick with the correct arguments, it never manipulates the image data.

rafaelfaria commented 9 years ago

This is weird.

I have 2 crops before i'm adding to the database, and it adds to the database before the crops are done.