mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-12 00:45:47 +01:00
changed to crop
This commit is contained in:
@@ -171,13 +171,12 @@ var user = require('./../user.js'),
|
|||||||
user.setUserField(uid, 'uploadedpicture', imageUrl);
|
user.setUserField(uid, 'uploadedpicture', imageUrl);
|
||||||
user.setUserField(uid, 'picture', imageUrl);
|
user.setUserField(uid, 'picture', imageUrl);
|
||||||
|
|
||||||
var im = require('node-imagemagick');
|
require('node-imagemagick').crop({
|
||||||
|
|
||||||
im.resize({
|
|
||||||
srcPath: uploadPath,
|
srcPath: uploadPath,
|
||||||
dstPath: uploadPath,
|
dstPath: uploadPath,
|
||||||
width: 128
|
width: 128,
|
||||||
}, function(err, stdout, stderr) {
|
height: 128
|
||||||
|
}, function(err, stdout, stderr){
|
||||||
if (err) {
|
if (err) {
|
||||||
// @todo: better logging method; for now, send to stderr.
|
// @todo: better logging method; for now, send to stderr.
|
||||||
// ideally, this should be happening in another process
|
// ideally, this should be happening in another process
|
||||||
@@ -232,7 +231,7 @@ var user = require('./../user.js'),
|
|||||||
function api_method(req, res) {
|
function api_method(req, res) {
|
||||||
|
|
||||||
var callerUID = req.user ? req.user.uid : 0;
|
var callerUID = req.user ? req.user.uid : 0;
|
||||||
console.log(req.user);
|
|
||||||
var userslug = req.params.userslug;
|
var userslug = req.params.userslug;
|
||||||
var section = req.params.section ? String(req.params.section).toLowerCase() : null;
|
var section = req.params.section ? String(req.params.section).toLowerCase() : null;
|
||||||
|
|
||||||
@@ -373,7 +372,7 @@ var user = require('./../user.js'),
|
|||||||
user.get_uid_by_userslug(userslug, function(uid) {
|
user.get_uid_by_userslug(userslug, function(uid) {
|
||||||
|
|
||||||
if(uid === null) {
|
if(uid === null) {
|
||||||
callback(null)
|
callback(null);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user