biati-digital / glightbox

Pure Javascript lightbox with mobile support. It can handle images, videos with autoplay, inline content and iframes
MIT License
2.01k stars 226 forks source link

Images have not the full height #441

Closed Offerel closed 1 year ago

Offerel commented 1 year ago

Describe the bug I have tried to adopt your settings from the demo site at https://biati-digital.github.io/glightbox/. On the demo site, in the first example, the images are zoomed to full height. In my case, they appear a lot smaller. The Full sized image has 3000x4000 pixel and should easily fill the screen.

Are you able to reproduce the bug in the demo site No.

Expected behavior The images should have the right size. Additionally, for some reason, there is a white area, but i dont have set a description.

Code Hint: The images are dynamically generated from PHP, thats why i use simg.php?p=52&t=2 as the image. Main PHP code for output the image is:

$content = file_get_contents($path);
header("Content-Type: $mimeType");
die($content);
<html class="" lang="en"><head>
            <meta charset="UTF-8">
            <meta http-equiv="X-UA-Compatible" content="IE=Edge">
            <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
            <title>Test</title>
            <link rel="stylesheet" href="css/justifiedGallery.min.css" type="text/css">
            <link rel="stylesheet" href="css/main.min.css" type="text/css">
            <link rel="stylesheet" href="css/glightbox.css" type="text/css">
            <link rel="stylesheet" href="js/plyr/plyr.css" type="text/css">
            <script nonce="4546c25651c721135462fac70aa84174" src="../../program/js/jquery.min.js"></script>
            <script nonce="4546c25651c721135462fac70aa84174" src="js/jquery.justifiedGallery.min.js"></script>
            <script nonce="4546c25651c721135462fac70aa84174" src="js/plyr/plyr.js"></script>
            <script nonce="4546c25651c721135462fac70aa84174" src="js/glightbox/glightbox.js"></script>
        </head>
        <body class="">
                <div id="images" class="justified-gallery">
                    <a class="glightbox" href="simg.php?p=52&t=2"><img src="simg.php?p=52&t=1" alt=""></a>
                    <a class="glightbox" href="simg.php?p=54&t=2"><img src="simg.php?p=54&t=1" alt=""></a>
                    <a class="glightbox" href="simg.php?p=53&t=2"><img src="simg.php?p=53&t=1" alt=""></a>
                    <a class="glightbox" href="simg.php?p=112&t=2"><img src="simg.php?p=112&t=1" alt=""></a>
                    <a class="glightbox" href="simg.php?p=111&t=2"><img src="simg.php?p=111&t=1" alt=""></a>
                    <a class="glightbox" href="simg.php?p=110&t=2"><img src="simg.php?p=110&t=1" alt=""></a>
                    <a class="glightbox" href="simg.php?p=109&t=2"><img src="simg.php?p=109&t=1" alt=""></a>
                    <a class="glightbox" href="simg.php?p=108&t=2"><img src="simg.php?p=108&t=1" alt=""></a>
                    <a class="glightbox" href="simg.php?p=107&t=2"><img src="simg.php?p=107&t=1" alt=""></a>
                    <a class="glightbox" href="simg.php?p=106&t=2"><img src="simg.php?p=106&t=1" alt=""></a>
                    <a class="glightbox" href="simg.php?p=105&t=2"><img src="simg.php?p=105&t=1" alt=""></a>
                    <a class="glightbox" href="simg.php?p=104&t=2"><img src="simg.php?p=104&t=1" alt=""></a>
                    <a class="glightbox" href="simg.php?p=103&t=2"><img src="simg.php?p=103&t=1" alt=""></a>
                    <a class="glightbox" href="simg.php?p=102&t=2"><img src="simg.php?p=102&t=1" alt=""></a>
                    <a class="glightbox" href="simg.php?p=101&t=2"><img src="simg.php?p=101&t=1" alt=""></a>
                </div>
    <script nonce="4546c25651c721135462fac70aa84174">
        $('#images').justifiedGallery({
            rowHeight: 220,
            maxRowHeight: 220,
            margins: 7,
            border: 0,
            lastRow: 'justify',
            captions: true,
            randomize: false
        });
        var lightbox = GLightbox();
    </script></body></html>

Screenshots Bildschirmfoto vom 2023-07-27 18-04-10

Desktop:

Offerel commented 1 year ago

Maybe i found the issue. It seems I have to make use of data-type, to specify if I have a image or video. Because of the php extension, the script doesn't know what type it is.

Anyway nice script, many thx for creating and maintain it. It works nicely together with Justified Gallery