Maintain aspect ratio in a thumbnail column regardless of row height

Lexignot 85 Reputation points
2024-05-17T13:11:30.5833333+00:00

Hello,

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!

Thumbnail

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

Accepted answer
  1. Haoyan Xue_MSFT 20,986 Reputation points Microsoft Vendor
    2024-05-20T07:04:49.2333333+00:00

    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