Share via

Why does SPO rotate images in a picture library?

Anonymous
2020-07-06T18:27:08+00:00

I'm cropping images employees have uploaded to a square for a directory, but SP insists on rotating anything that's got a portrait aspect ratio. This doesn't happen in any other platform I"ve used so it's definitely a SP flaw. Here's the code that gets output:

<img title="employee name" style="object-fit: cover;margin-left: 0px;margin-right: 15px;height: 100%;width: 150px;" src="https://xxx.sharepoint.com/sites/xxx/xxxDirectory/_t/headshot_jpg.jpg">

I can adjust the code if that's what's needed, but nothing I've tried fixes this. Also if I look at the image in the library neither the thumbnail tile view nor the "original" get rotated so this is definitely something SP is changing for absolutely no reason once the image file is sent back to the browser. If this is a bug, when will it be fixed?

Microsoft 365 and Office | SharePoint | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

7 answers

Sort by: Most helpful
  1. Anonymous
    2020-07-10T20:20:31+00:00

    That doesn't really help, except to prove it's a common problem as I said. It's obviously not a problem with EXIF data because the images appear correctly everywhere except in the web part. And I don't see this issue on any other platform so it's clearly a SP problem. I can't ask users to edit their images or save them as pngs, and if I have to do it, Msft will have to pay for my time, since it's their flawed functionality causing the issue.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2020-07-09T01:55:39+00:00

    I'm sure you're aware of this because it's not a new problem and I've seen others asking about it but with no resolution. The images are uploaded by users so aren't edited by me. I believe the problem ones were selfies shot with a phone in portrait mode so are 1000px high by 750px wide. As I said, they look fine in the library views like your screenshot but get rotated when displayed in a web part on a page. In this case I'm using a search web part for display but the same thing happens in any web part.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  3. Anonymous
    2020-07-09T10:58:25+00:00

    Hi webbrewers3,

    Thank you for your reply and updates. I also did a few more tests based on your latest description, which I edited some image (Jpeg format) into portrait mode (1000px high by 750px) to picture library. Then add some web part in modern page, such as Library web part, Image gallery web part, image web part. It seems that the portrait image can still be displayed correctly without auto rotation.

     

    At meantime, I also did some researches and found a similar third-party thread about SharePoint Rotating Pictures in Library.

    Disclaimer: Microsoft provides no assurances and/or warranties, implied or otherwise, and is not responsible for the information you receive from the third-party linked sites or any support related to technology. ​

    It seems that the rotation is related to the image format as some users pointed out.

    May I know what is the image format your user edited and upload to SharePoint picture library?

    Best regards,

    Dihao

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2020-07-08T08:51:53+00:00

    Hi webbrewers3, 

    Regarding to this question, may I know is there any update? Please post back here and share above information with us at your convenience. Thank you.

    Best regards,

    Dihao

    Was this answer helpful?

    0 comments No comments
  5. Anonymous
    2020-07-07T07:59:46+00:00

    Hi webbrewers3,

    Thank you for posting your query here. Based on your description, you found that the image you upload to SharePoint Picture Library will be automatically rotate after you cropped and edit the image.

    I am not quite sure, how you edit the image. However I did a test in my test environment, where I edited some images on my computer with Painter or Windows Photo, and upload to SharePoint Picture Library, the images still remain as the position, as the landscape images are still in landscape, the portrait images are remained as portrait aspect ratio.

     

    If my reproduce steps are different from yours, please point out and correct me. Thank you.

    In addition, I noticed that you mentioned “the image file is sent back to the browser”, may I know how did you edit your image and “send back” to SharePoint Picture Library? It sounds like you are editing the image in some programs and sending the edited images directly to SharePoint Picture Library.

    Best regards,

    Dihao

    Was this answer helpful?

    0 comments No comments