Page MenuHomePhabricator

Actual 2x avatar, new profile picture options
ClosedPublic

Authored by chad on Dec 4 2015, 5:28 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Apr 14, 9:19 PM
Unknown Object (File)
Sun, Apr 7, 3:45 PM
Unknown Object (File)
Sat, Apr 6, 4:17 AM
Unknown Object (File)
Sun, Mar 31, 1:24 PM
Unknown Object (File)
Thu, Mar 28, 1:10 AM
Unknown Object (File)
Mar 11 2024, 7:30 PM
Unknown Object (File)
Mar 11 2024, 6:43 PM
Unknown Object (File)
Mar 11 2024, 6:13 PM
Subscribers
Tokens
"Like" token, awarded by cburroughs.

Details

Summary

Provides a real 2x avatar and offers new built in images for profile pictures.

Test Plan

reload profile, see sharper image, pick eevee, see eevee

Diff Detail

Repository
rP Phabricator
Branch
prof-pics
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 9288
Build 11024: Run Core Tests
Build 11023: arc lint + arc unit

Event Timeline

chad retitled this revision from to Actual 2x avatar.
chad updated this object.
chad edited the test plan for this revision. (Show Details)
chad added a reviewer: epriestley.

Basically, I'd like to maybe do one or two things:

  1. Give a different default image for whatever your UID ends in, 0-9.
  2. Give a selection of images to choose from in Edit Picture.

For defaults, something like:

  • Change PhabricatorUser::getDefaultProfileImageURI() to be $user->getDefaultProfileImageURI(), since it now depends on which user we're asking about.
  • Change callsites call it as $user->... (hopefully no weird/hard ones).
  • For users with an ID, use $user->getID() % 10 or similar to select an image. For users without an ID (logged out users, omnipotent user) choose the default or some special image.
  • Existing images will be cached. You can add a 2 or something to the array in PhabricatorUser->getProfileImageVersion() to break the cache.

For choosing, something like:

  • In PhabricatorPeopleProfilePictureController, change this line:
$default_image = PhabricatorFile::loadBuiltin($viewer, 'profile.png');

...to pick an image based on $viewer instead (profile2.png, or whatever). This will give you a consistent default image (but not a choice between multiple images).

  • If you want to add more default options, use PhabricatorFile::loadBuiltin() to load builtin files and then just dump them into $images:
$builtins = array('x.png', 'y.png');
foreach ($builtins as $builtin) {
  $file = PhabricatorFile::loadBuiltin($builtin);
  $images[$file->getPHID()] = array(
    'uri' => $file->getBestURI(),
    'tip' => pht('Builtin Image'),
  );
}

That should make them show up, I think.

chad edited edge metadata.
  • update to allow users to pick
chad retitled this revision from Actual 2x avatar to Actual 2x avatar, new profile picture options.Dec 4 2015, 8:49 PM
chad updated this object.
chad edited the test plan for this revision. (Show Details)
epriestley edited edge metadata.
This revision is now accepted and ready to land.Dec 4 2015, 9:21 PM
This revision was automatically updated to reflect the committed changes.