kolkov / ngx-gallery

A simple responsive native gallery component for Angular 8+.

Home Page:https://ngx-gallery.kolkov.ru/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fixed gallery size

wakatanka opened this issue · comments

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

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.

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,

thanks a lot