diff --git a/src/applications/auth/controller/oauthregistration/PhabricatorOAuthDefaultRegistrationController.php b/src/applications/auth/controller/oauthregistration/PhabricatorOAuthDefaultRegistrationController.php index 9c8c157690..3f3c114d9d 100644 --- a/src/applications/auth/controller/oauthregistration/PhabricatorOAuthDefaultRegistrationController.php +++ b/src/applications/auth/controller/oauthregistration/PhabricatorOAuthDefaultRegistrationController.php @@ -107,7 +107,16 @@ final class PhabricatorOAuthDefaultRegistrationController 'name' => $provider->getProviderKey().'-profile.jpg', 'authorPHID' => $user->getPHID(), )); - $user->setProfileImagePHID($file->getPHID()); + $xformer = new PhabricatorImageTransformer(); + + // Resize OAuth image to a reasonable size + $small_xformed = $xformer->executeProfileTransform( + $file, + $width = 50, + $min_height = 50, + $max_height = 50); + + $user->setProfileImagePHID($small_xformed->getPHID()); } try { diff --git a/src/applications/people/controller/settings/panels/PhabricatorUserOAuthSettingsPanelController.php b/src/applications/people/controller/settings/panels/PhabricatorUserOAuthSettingsPanelController.php index 8f8dbf8fd4..031112b9cd 100644 --- a/src/applications/people/controller/settings/panels/PhabricatorUserOAuthSettingsPanelController.php +++ b/src/applications/people/controller/settings/panels/PhabricatorUserOAuthSettingsPanelController.php @@ -217,7 +217,17 @@ final class PhabricatorUserOAuthSettingsPanelController 'name' => $provider->getProviderKey().'-profile.jpg', 'authorPHID' => $user->getPHID(), )); - $user->setProfileImagePHID($file->getPHID()); + + $xformer = new PhabricatorImageTransformer(); + + // Resize OAuth image to a reasonable size + $small_xformed = $xformer->executeProfileTransform( + $file, + $width = 50, + $min_height = 50, + $max_height = 50); + + $user->setProfileImagePHID($small_xformed->getPHID()); $user->save(); } else { $error = 'Unable to retrieve image.';