meteor-imagemagick icon indicating copy to clipboard operation
meteor-imagemagick copied to clipboard

No callback from resize/crop

Open ghost opened this issue 10 years ago • 4 comments

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?

ghost avatar Mar 18 '14 03:03 ghost

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.

sylvaingi avatar Mar 18 '14 08:03 sylvaingi

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?

ghost avatar Mar 18 '14 09:03 ghost

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.

sylvaingi avatar Mar 18 '14 11:03 sylvaingi

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.

rafaelfaria avatar Feb 11 '15 08:02 rafaelfaria