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)
Wed, Dec 18, 2:36 AM
Unknown Object (File)
Sat, Dec 14, 1:53 PM
Unknown Object (File)
Fri, Dec 13, 7:12 AM
Unknown Object (File)
Fri, Dec 13, 1:49 AM
Unknown Object (File)
Fri, Dec 6, 9:09 AM
Unknown Object (File)
Mon, Dec 2, 11:05 AM
Unknown Object (File)
Mon, Dec 2, 11:05 AM
Unknown Object (File)
Mon, Dec 2, 10:53 AM
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.