Maintain aspect ratio in a thumbnail column regardless of row height

Lexignot 85 Reputation points


In SharePoint, is there a way to keep the initial ratio of an image/video in a thumbnail column (i.e. Image column within a Document Library)?

It appears that the thumbnail is trying to match image height with the row height regardless of the the initial aspect ratio (see below with different row heights for the same picture.). This should be doable by encoding the JSON file, but I haven't had any luck with chatGPT and my online research...

Thanks in advance for your help with this!


A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,070 questions
{count} votes

Accepted answer
  1. Haoyan Xue_MSFT 21,401 Reputation points Microsoft Vendor

    Hi @Lexignot ,

    Thank you for posting in this community.

    Per my knowledge, SharePoint column formatting does not currently support the object-fit property.

    We can't achieve automatic scaling of images proportionally to column widths.

    Thank you for your understanding!

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful