From: Zach Copley Date: Tue, 27 Sep 2011 04:31:41 +0000 (+0000) Subject: Do a better job of saving the original avatar from Facebook X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=000e5c0c0195d08aa0e06b1485c299fb9a0d48b7;p=quix0rs-gnu-social.git Do a better job of saving the original avatar from Facebook --- diff --git a/plugins/FacebookBridge/actions/facebookfinishlogin.php b/plugins/FacebookBridge/actions/facebookfinishlogin.php index 260761e862..4c8c9f860f 100644 --- a/plugins/FacebookBridge/actions/facebookfinishlogin.php +++ b/plugins/FacebookBridge/actions/facebookfinishlogin.php @@ -458,9 +458,13 @@ class FacebookfinishloginAction extends Action common_log(LOG_WARNING, 'Couldn\'t save tmp Facebook avatar: ' . $tmpname, __FILE__); } else { // save it as an avatar + + $file = new ImageFile($user->id, Avatar::path($tmpname)); + $filename = $file->resize(180); // size of the biggest img we get from Facebook + $profile = $user->getProfile(); - if ($profile->setOriginal($tmpname)) { + if ($profile->setOriginal($filename)) { common_log( LOG_INFO, sprintf( @@ -475,7 +479,7 @@ class FacebookfinishloginAction extends Action __FILE__ ); - // clean up + // clean up tmp file @unlink(Avatar::path($tmpname)); }