1 var imagePath = path.join('/images/logo.png', 'logo.png');
2
3 if (fs.statSync(imagePath)) {
4 var bitmap = fs.readFileSync(imagePath);
5 var bufferImage = new Buffer(bitmap);
6
7 Magic = mmm.Magic;
8 var magic = new Magic(mmm.MAGIC_MIME_TYPE);
9 magic.detectFile(imagePath, function(err, result) {
10 if (err) throw err;
11 datas = [{"buffer": bufferImage, "mimetype": result, "originalname": path.basename(imagePath)}];
12 var JsonDatas= JSON.parse(JSON.stringify(datas));
13 log.notice(JsonDatas);
14 });
15 }
16