mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-15 17:10:50 +01:00
fix convert-avatars-to-png option not being honored
This commit is contained in:
@@ -57,11 +57,13 @@ module.exports = function(User) {
|
||||
}, next);
|
||||
},
|
||||
function(next) {
|
||||
if (convertToPNG) {
|
||||
image.normalise(picture.path, extension, next);
|
||||
} else {
|
||||
next();
|
||||
if (!convertToPNG) {
|
||||
return next();
|
||||
}
|
||||
async.series([
|
||||
async.apply(image.normalise, picture.path, extension),
|
||||
async.apply(fs.rename, picture.path + '.png', picture.path)
|
||||
], next);
|
||||
},
|
||||
function(next) {
|
||||
User.getUserField(updateUid, 'uploadedpicture', next);
|
||||
@@ -225,4 +227,4 @@ module.exports = function(User) {
|
||||
User.removeCoverPicture = function(data, callback) {
|
||||
db.deleteObjectField('user:' + data.uid, 'cover:url', callback);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user