mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-07 22:45:46 +01:00
closes #497
This commit is contained in:
@@ -207,11 +207,6 @@ var user = require('./../user.js'),
|
|||||||
is.on('end', function () {
|
is.on('end', function () {
|
||||||
fs.unlinkSync(tempPath);
|
fs.unlinkSync(tempPath);
|
||||||
|
|
||||||
var imageUrl = nconf.get('upload_url') + filename;
|
|
||||||
|
|
||||||
user.setUserField(uid, 'uploadedpicture', imageUrl);
|
|
||||||
user.setUserField(uid, 'picture', imageUrl);
|
|
||||||
|
|
||||||
require('node-imagemagick').crop({
|
require('node-imagemagick').crop({
|
||||||
srcPath: uploadPath,
|
srcPath: uploadPath,
|
||||||
dstPath: uploadPath,
|
dstPath: uploadPath,
|
||||||
@@ -220,8 +215,17 @@ var user = require('./../user.js'),
|
|||||||
}, function (err, stdout, stderr) {
|
}, function (err, stdout, stderr) {
|
||||||
if (err) {
|
if (err) {
|
||||||
winston.err(err);
|
winston.err(err);
|
||||||
|
res.send({
|
||||||
|
error: 'Invalid image file!'
|
||||||
|
});
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var imageUrl = nconf.get('upload_url') + filename;
|
||||||
|
|
||||||
|
user.setUserField(uid, 'uploadedpicture', imageUrl);
|
||||||
|
user.setUserField(uid, 'picture', imageUrl);
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
path: imageUrl
|
path: imageUrl
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user