Setting profile picture sometimes results in picture rotating 90 degrees

Yves Rosius 0 Reputation points
2024-05-29T12:05:48.54+00:00

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 Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,447 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Danstan Onyango 3,816 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.

    0 comments No comments