kolkov / ngx-gallery

A simple responsive native gallery component for Angular 8+.
https://ngx-gallery.kolkov.ru/
MIT License
115 stars 56 forks source link

fixed gallery size #37

Closed wakatanka closed 4 years ago

wakatanka commented 4 years ago

Hi, i've setted with and height in galleryoptions, say w400 and h600, but the gallery came always bigger (img are big), there is a way to force a fixed size and have images adapted?

thanks

wakatanka commented 4 years ago

Well, i found the way, but the image is cutted, i've tryed the option: imageSize: NgxGalleryImageSize.Cover or imageSize: NgxGalleryImageSize.Contain, but the result is the same.

windcloak commented 4 years ago

Are you talking about the Carousel? You should set the width and height to your max width/height and use Contain. I use Easy Thumbnails to resize my photos; if your photos are huge, you should resize them.

My images are either 800x533 or 533x800, so I use 800x800 as the size

                // Size of Carousel
                width: '800px',
                height: '800px',

                // Carousel
                imageSize: 'contain',
                imagePercent: 100,
                imageSwipe: true,
                imageAutoPlay: true,
                imageAutoPlayPauseOnHover: true,
                imageAutoPlayInterval: 8000,
                imageAnimation: NgxGalleryAnimation.Slide,
wakatanka commented 4 years ago

thanks a lot