I use meteor (which is built on node) and CollectionCFS (which allows me to use gm [GraphicsMagick] for finger-nails).
I am doing the following to automatically create a thumbnail of uploaded images:
new FS.Store.FileSystem("thumbs", { transformWrite: function(fileObj, readStream, writeStream) { gm(readStream, fileObj.name()).resize('100', '100').stream().pipe(writeStream); }, path: "/Volumes/Public/Thumbs", })
The transformWrite function receives a readStream (source image), modifies it, and passes the results to writeStream. How can I create thumbnails of PDF files?
source share