Wednesday, 8 May 2013

User Profile Picture Uploader (crop and upload on behalf of other users)

I just finished updating a webpart I wrote a while back that allows administrative users to upload, crop (enforcing a square image for proper rendering in SharePoint, Outlook, Lync, etc) and save a profile photo for a given users user profile in SharePoint. This allows for scenarios where HR or Marketing control the user profile photos uploaded for employees.

It allows you to configure the user profile picture property as "Do not allow users to edit values for this property", thus preventing employees removing photos or adding inappropriate photos, while still allowing the profile photo administrators with the ability to add/edit user profile photos.

The webpart ensures the photo uploaded is a JPEG image, the three image variations are created (144px, 96px, 32px), and makes sure the URL (PictureURL) property is correctly formatted so that user profile synchronization with Active Directory works if you are exporting profile images to Active Directory.

The webpart looks like this:

If you want to try it, you can download the WSP and User Guide from the Microsoft TechNet Gallery here: User Profile Picture Uploader