From 5c84a3adb50077fe85dc785da4cb2614c6d4db4d Mon Sep 17 00:00:00 2001 From: barisusakli Date: Wed, 13 Aug 2014 18:25:26 -0400 Subject: [PATCH] closes #1974 --- install/data/defaults.json | 4 ++++ src/controllers/accounts.js | 3 ++- src/user.js | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/install/data/defaults.json b/install/data/defaults.json index fc5369de82..0ecd7b5fd1 100644 --- a/install/data/defaults.json +++ b/install/data/defaults.json @@ -63,6 +63,10 @@ "field": "maximumProfileImageSize", "value": 256 }, + { + "field": "profileImageDimension", + "value": 128 + }, { "field": "chatMessagesToDisplay", "value": 50 diff --git a/src/controllers/accounts.js b/src/controllers/accounts.js index f2be462147..15bfd0a17b 100644 --- a/src/controllers/accounts.js +++ b/src/controllers/accounts.js @@ -398,10 +398,11 @@ accountsController.uploadPicture = function (req, res, next) { } var updateUid = req.user.uid; + var imageDimension = parseInt(meta.config.profileImageDimension, 10) || 128; async.waterfall([ function(next) { - image.resizeImage(req.files.userPhoto.path, extension, 128, 128, next); + image.resizeImage(req.files.userPhoto.path, extension, imageDimension, imageDimension, next); }, function(next) { if (parseInt(meta.config['profile:convertProfileImageToPNG'], 10) === 1) { diff --git a/src/user.js b/src/user.js index 6cd1589a45..0919406089 100644 --- a/src/user.js +++ b/src/user.js @@ -279,7 +279,7 @@ var } var options = { - size: '128', + size: parseInt(meta.config.profileImageDimension, 10) || 128, default: customGravatarDefaultImage || meta.config.defaultGravatarImage || 'identicon', rating: 'pg' };