SharePoint / sp-dev-docs

SharePoint & Viva Connections Developer Documentation
https://docs.microsoft.com/en-us/sharepoint/dev/
Creative Commons Attribution 4.0 International
1.25k stars 1.02k forks source link

SharePoint driveItem thumbnail quality returned from Microsoft Graph API is really poor #9936

Open jamesmacwhite opened 1 month ago

jamesmacwhite commented 1 month ago

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

πŸ’₯ SharePoint Framework

Developer environment

None

What browser(s) / client(s) have you tested

Additional environment details

Microsoft Graph API.

Describe the bug / error

When fetching a thumbnail using the SharePoint driveItem method obtained from a content item such as a sitePage, listItem or hero web part that uses an image the quality of the returned generated thumbnail is really low. Compression is expected, but this goes beyond typical compression.

Original imageUrl provided from hero web part component which references a newsPost item content

The generated thumbnail using sites/$siteId/lists/$listId/items/$id/driveItem/thumbnails/0/large

thumbnail

While the thumbnail is expected to be compressed and lower quality than the original, the quality of the thumbnail seems very poor. The jagged edges around letters and shapes is very noticeable. I don't remember this happening previously when testing this.

Steps to reproduce

Fetch a thumbnail for an image that is uploaded on SharePoint through the Microsoft Graph API.

Expected behavior

Quality to be lower but not massively noticeable or low quality like the result shown, where objects like letters have noticeable tearing and unsharp lines.

jamesmacwhite commented 1 month ago

Also appears to be happening on other image content, for example an events calendar from a list, not exclusive to a hero web part, it seems like the image quality returned from the https://uksouth1-mediap.svc.ms endpoint. It's not on the original image.

harry6561 commented 1 month ago

My customer is facing the same issue. May I know what the cause of this change? It was working fine for two years.

jamesmacwhite commented 1 month ago

My customer is facing the same issue. May I know what the cause of this change? It was working fine for two years.

Thanks for replying and that you've noticed the same. I don't know when this started happening, we use the thumbnail path within the Microsoft Graph API to provide public paths to images which we can upload in another system, given the thumbnail URL is only valid for 1 hour. Certain types of images show up the issue more than others, but the compression seems to be much more aggressive/lower quality compared to what I remember it being.

jamesmacwhite commented 1 month ago

I am seeing better image quality more recently if anyone else can confirm?