MurhafSousli / ngx-gallery

Angular Gallery, Carousel and Lightbox
https://ngx-gallery.netlify.app/
MIT License
610 stars 129 forks source link

Using thumb as src for thumbnails #319

Closed nartc closed 4 years ago

nartc commented 4 years ago

Hi, thanks for the great library.

What is the current behavior?

https://github.com/MurhafSousli/ngx-gallery/blob/master/projects/core/src/lib/components/templates/gallery-image.component.ts#L28 This line uses the imageSrc for the backgroundImage on g-image-item. The problem is if the src image is big then the Lightbox would load a big image for the thumbnails which will make it feel really sluggish.

What is the expected behavior?

Thumbnails should use data.thumb as backgroundImage instead of imageSrc.

What is the use-case or motivation for changing an existing behavior?

Large payloads on thumbnails

Which versions are you using for the following packages?

Angular: 9rc9 Angular CDK: 9rc9 Angular CLI: Typescript: 3.7 Gallery: 4

Is there anything else we should know?

MurhafSousli commented 4 years ago

Thumbnails uses the large image source only if user has not provided the thumb src when you load the images into the gallery. Please provide a reproduction!

nartc commented 4 years ago

My mistake. The gallery-thumb passes data.thumb down to the gallery-image which is a common component to render Image. Thanks for the response!