Another day, another discovery on my quest to migrate our farm from SharePoint 2010 to SharePoint 2013. I started noticing image quality problems with the user thumbnail images in my upgraded farm: The small and large thumbnail images were looking very blurry. This was particularly evident when I viewed my My Site Host’s People page (MyPeople.aspx). The photo of myself on the left side was fairly blurry, but the small photos of the people I am following were nearly indistinguishable. Okay, what’s going on here?
Well, it turns out that Microsoft has changed the default thumbnail sizes for User Profile photos in SharePoint 2013. Here’s a comparison of the maximum dimensions (pixels) as given in Microsoft.Office.Server.UserProfiles.UserProfilePhotos:
|
Max pixels |
Thumbnail |
SP2010 |
SP2013 |
Large |
144 |
300 |
Medium |
96 |
72 |
Small |
32 |
48 |
As you can see, the dimensions for the large and small images have increased but has decreased for the medium image.
The new dimensions for the medium and small images isn’t much of a problem thanks to the handy dandy PowerShell cmdlet Update-SPProfilePhotoStore
(read more at TechNet). The detailed description given in the TechNet reference still refers to 2007, but what this cmdlet does still apply to upgrades from 2010. By executing Update-SPProfilePhotoStore -MySiteHostCollection http://sppaule/my
my thumbnail images were regenerated to match the default sizes desired by the system.
There’s still one gliche: SharePoint’s thumbnail image creation routine (found in Microsoft.Office.Server.UserProfiles.UserProfilePhotos) won’t enlarge images. (I’ve got a background in design and photography and can say with assurity that this is a good thing!) This means the large thumbnails stay at a maximum 144 pixels. Since they are displayed at 200 pixels, the image is thus enlarged by the browser by 38% causing bluriness. Unfortunately, unless you have a repository of higher resolution images of your users, you’re stuck.
This is where I think the new Image Renditions can come in quite handy. For more information about Image Renditions, I highly recommend MVP Waldek Mastykarz’s wonderful post “Image Renditions in SharePoint 2013.” If the User Profile Photos were to use Image Renditions, your originally uploaded file could be stored for use whenever the preset thumbnail sizes were inadequate. This would allow for a regeneration of the large thumbnail image should it’s default size increase again in the future. Not only that, but uploading a file could conceivably trigger a scaling-and-cropping UI similar to that used by Image Renditions (hopefully a little simpler) wherein the user uploading the photo could scale and crop the original photo right in the browser!
For SP2010, I gave our HR department a webpart which did allow them to scale and crop the original right in the browser (using Jcrop) and stored the original photo in another photo library. Now I’m just kicking myself for not storing the cropping information as properties/fields along with the original photo. Had I done so, I’d be able to programmatically regenerate the large thumbnail images at the new SharePoint 2013 largeThumbnailSize of 300 pixels and perhaps even implement something using Image Renditions. (Fortunately, my webpart actually saves the cropped image at full resolution. So, I only need to rescale the images programmatically in order to generate new large thumbnails for SharePoint 2013. Phew!)
One final note: Update-SPProfilePhotoStore
has one other side benefit for which I’d like to give my gratitude to the Microsoft team who put it together! In our migration to SharePoint 2013, we are changing our web application’s default zone to a different domain name and moving the My Site Host under this web application (lots of work and not particularly recommended to have the My Site Host under the same web application, but it’s going to save our users–and thus me–a lot of headache). Thus, when the User Profile Service was upgraded from SharePoint 2010 to SharePoint 2013, all of the user’s profile photos were still pointing to the old domain name. Fortunately, the old farm was still running and accessible under the old domain name. Having not migrated the My Sites Host content (I wanted to start clean with a 2013 My Sites Host), I didn’t have the user photos in the new SP2013 farm. I ended up writing a console application which would copy the user photos I needed from the old farm to the new farm (hence my last post). Turns out, that wasn’t necessary. To my surprise–and the credit of the Microsoft team–Update-SPProfilePhotoStore
retrieved the photo from the old farm using the URLs in the new farm’s user profiles, resized them (except for the large thumbnail as spoken of above), stored the sizes (144, 72, and 48) in the new farm, and updated the URL in the user profile to point to the new 2013 My Sites Host > User Photos > Profile Photos. SLICK!
So, despite the shift in default image sizes for User Photo thumbnails, there is a convenient way to update your thumbnails. If Microsoft were to integrate Image Renditions with the User Photos, the whole process will become much more robust for all SharePoint consumers. I’m crossing my fingers!
Read Full Post »