Provides a real 2x avatar and offers new built in images for profile pictures.
Details
Details
- Reviewers
epriestley - Commits
- Restricted Diffusion Commit
rPb482027687f2: Actual 2x avatar, new profile picture options
reload profile, see sharper image, pick eevee, see eevee
Diff Detail
Diff Detail
- Repository
- rP Phabricator
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
Basically, I'd like to maybe do one or two things:
- Give a different default image for whatever your UID ends in, 0-9.
- Give a selection of images to choose from in Edit Picture.
Comment Actions
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.