|
|
|
@ -176,8 +176,7 @@ var fs = require('fs'),
|
|
|
|
|
user.setUserField(uid, 'picture', imageUrl);
|
|
|
|
|
|
|
|
|
|
if (convertToPNG && extension !== '.png') {
|
|
|
|
|
im.convert([uploadPath, 'png:-'],
|
|
|
|
|
function(err, stdout){
|
|
|
|
|
im.convert([uploadPath, 'png:-'], function(err, stdout) {
|
|
|
|
|
if (err) {
|
|
|
|
|
winston.err(err);
|
|
|
|
|
res.send({
|
|
|
|
@ -187,13 +186,16 @@ var fs = require('fs'),
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fs.writeFileSync(uploadPath, stdout, 'binary');
|
|
|
|
|
res.json({
|
|
|
|
|
path: imageUrl
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
res.json({
|
|
|
|
|
path: imageUrl
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(extension === '.gif') {
|
|
|
|
|
im.convert([uploadPath, '-coalesce', '-repage', '0x0', '-crop', '128x128+0+0', '+repage', 'uploadPath'], function(err, stdout) {
|
|
|
|
|