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 Security | Microsoft Graph

2 answers

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

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments

  2. Jayson Collins 0 Reputation points
    2026-02-04T23:59:50.0166667+00:00

    Microsoft is the only company that could possibly make updating a profile pic a complicated thing.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.