sachinchoolur / lightGallery

A customizable, modular, responsive, lightbox gallery plugin.
https://www.lightgalleryjs.com/
Other
6.55k stars 1.29k forks source link

Zoom does not work properly if thumbnail aspect ratio is different #1661

Closed jusxon closed 2 months ago

jusxon commented 2 months ago

Description

When the thumbnails are, for example, square and the images are portrait or landscape, the image zoom animation is distorted on zoom and zoom-out.

This is with "data-lg-size" set. Third image works correctly because target image is same aspect ratio.

Example: https://codepen.io/50foot/pen/MWMLByg

https://github.com/user-attachments/assets/11ccccbb-a46d-4ff8-95eb-8fc64f9c4d41

Steps to reproduce

Use different aspect ratio for thumbnails than the linked image.

jusxon commented 2 months ago

I realized this could not work without something like object-fit and that is not supported.

joeworkman commented 1 week ago

I am not sure why this was closed. It is a valid request. Having a square thumbnails is a common design for galleries. I would love to see a better way to handle this @sachinchoolur