node-imager
node-imager copied to clipboard
Better file type checking
Uploading a image with the extension .jpeg but that is actually a gif makes imagemagic puke.
See enclosed gif.

@MarZab thanks for this issue! I am planning to use https://github.com/mscdex/mmmagic which is able to detect mime type by reading the file. Waiting for mmmagic/issues/16 to be resolved...
I have re-written imager, if you want to give a try here is a pre-release https://github.com/imagerjs/imager/releases/tag/1.0.0-alpha1
no file header crashes node
type: typeof(file) == 'string' ? mime.lookup(file) : file.type || file.mimetype || file.headers['content-type'],
should be
type: typeof(file) == 'string' ? mime.lookup(file) : file.type || file.mimetype || (file.headers && file.headers['content-type']),