lightbox2 icon indicating copy to clipboard operation
lightbox2 copied to clipboard

Image resizing issue

Open ironfrown opened this issue 1 year ago • 1 comments

Lightbox2 2.11.4 on Chrome+Firefox / Ubuntu 22.04

If an image does not fit the viewport, LB2 is checking which dimension is offending and fixes it. However, after resizing the other dimension may still be too large to fit in a viewport, requiring scrolling.

To reproduce, take any horizontal image larger than the browser window and reduce the browser height significantly, LM2 will fit the width but the height will be clipped.

Attached below - web page before and after image click. LM2_before LM2_after

ironfrown avatar Oct 01 '23 05:10 ironfrown

I would say just use CSS to fix this easily, but sizing is definitely an issue I too encountered when using Lightbox 2, and it should be fixed. Small images need to enlarge (>= 75% of screen height) and large images need to shrink (>= 75% of screen height). Below is the CSS override I'm using.

.lb-outerContainer {
    width: 90vw !important;
}

.lightbox .lb-image {
    width: 100% !important;
    height: unset !important;
}

faisalnjs avatar Oct 11 '23 02:10 faisalnjs