Microsoft is the only company that could possibly make updating a profile pic a complicated thing.
Setting profile picture sometimes results in picture rotating 90 degrees
Problem:
When setting a user profile picture using Microsoft.Graph PowerShell module, the resulting profile picture will be sometimes rotated 90 degrees.
Actions taken:
- Download picture from SharePoint Online library
- Compress picture conform limitations
- Set profile picture using
Set-MgUserPhotoContent -UserId $Email -InFile $CompressedFile
Troubleshooting:
- Issue also occurs when manually uploading the picture in Entra ID (GUI).
- Changing resolution to a square picture helps
- Using an online compression tool helps (not changing resolution)
The issue seems random. So, I would like to have a cause I can then work around.
Thanks!
Microsoft Security | Microsoft Graph
2 answers
Sort by: Most helpful
-
-
Danstan Onyango 3,911 Reputation points Microsoft Employee
2024-07-01T07:30:35.6866667+00:00 As per the docs, I don't see anything that should cause this. But reading the docs on profile photo specs
The supported sizes of HD photos on Microsoft 365 are as follows: 48x48, 64x64, 96x96, 120x120, 240x240, 360x360, 432x432, 504x504, and 648x648. Photos can be any dimension if they're stored in Microsoft Entra ID.
This explains why the square photo will work. My suggestion is to use other imaging tool o resize the pic to any of the above sizes and try again. If the issue persists after you optimize the photo size to standard, then reach out.