Last active
December 14, 2015 09:19
-
-
Save dileephell/5064310 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ExifImage = require('exif').ExifImage; | |
var easyimg= require('easyimage'); | |
var path = require('path'); | |
var uuid=require('node-uuid'); | |
var tmp_path = req.files.uploadimgs.path,uuid; | |
console.log(uuid); | |
fs.exists('/upload/work',function(exists){ | |
fs.mkdir('./upload/work',function() { | |
var target_path = './upload/work/'+uuid() +'.png'; | |
fs.rename(tmp_path, target_path, function(err) { | |
if (err) throw err; | |
console.log('cfgh'); | |
// delete the temporary file, so that the explicitly set temporary upload dir does not get filled with unwanted files | |
fs.unlink(tmp_path, function() { | |
if (err) throw err; | |
console.log('fdsggghggff'); | |
res.send('File uploaded to: ' + target_path + ' - ' + req.files.uploadimgs.size + ' bytes'); | |
try { | |
new ExifImage({ image : './home/dileep/Pictures/myimage.jpg'}, function (error, image) { | |
if (error) | |
console.log('Error: '+error.message); | |
else | |
console.log(image); // Do something with your data! | |
}); | |
} catch (error) { | |
console.log('Error: ' + error); | |
} | |
}); | |
}); | |
}); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment