question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Size (ratio) of image preview is incorrect

See original GitHub issue

Hi,

I’m using the lightbox-2.6 library and I have a problem with the size of the image in the popup.

The image is of a 4:3 ratio but it is displayed in the wrong ratio.

Here is the generated html for the popup preview:


<div id="lightbox" class="lightbox" style="display: block; top: 122px; left: 0px;">
    <div class="lb-outerContainer" style="width: 266px; height: 490px;">
        <div class="lb-container">
            <img class="lb-image" src="/LD/Photos/ylmcjjxq.jpg" style="display: block; width: 642px; height: 482px;">
            <div class="lb-nav" style="display: block;">
                <a class="lb-prev" href="" style="display: block;"></a>
            <a class="lb-next" href="" style="display: block;"></a>
        </div>
        <div class="lb-loader" style="display: none;">
            <a class="lb-cancel"></a>
        </div>
    </div>
</div>
<div class="lb-dataContainer" style="display: block; width: 266px;">
    <div class="lb-data">
        <div class="lb-details">
            <span class="lb-caption" style="display: none;"></span>
            <span class="lb-number">Image 7 of 10</span>
        </div>
        <div class="lb-closeContainer">
            <a class="lb-close"></a>
        </div>
    </div>
</div>
</div> ##

The lb-outerContainer seems to be the problem

<div class="lb-outerContainer" style="width: 266px; height: 490px;">

because the size of the img tag has the correct ratio

<img class="lb-image" src="/LD/Photos/ylmcjjxq.jpg" style="display: block; width: 642px; height: 482px;">

Thanks for your work and help.

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:32 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
bendolancommented, Jul 30, 2013

This problem looks similar to the bootstrap issue.

Please try adding the following to your CSS: .lb-image{ max-width: inherit; }

0reactions
mukesh019commented, Jul 8, 2017

however the lightbox currently lacks a window resize event. Please make sure the lightbox scales correctly when the window is resized.

pls help me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Displays images with incorrect aspect ratio
Learn how to display responsive images with the correct aspect ratio. ... There are two common causes for an incorrect image aspect ratio:....
Read more >
Incorrect aspect ratio for thumbnail/preview · Issue #212 - GitHub
Describe the bug Thumbnail/preview has incorrect aspect ratio for one of my images, as shown in screenshot below. The image is also linked...
Read more >
If PDFs or images aren't the correct size in Preview on Mac
In the Preview app on your Mac, choose Preview > Settings. To choose how to display documents, click PDF or Images, then choose...
Read more >
Incorrect aspect ratio of thumbnails on external drives
When I place pxd files somewhere on internal drive of Mac, thumbnails in the Finder will be displayed in the correct aspect ratio....
Read more >
Generated media have incorrect aspect ratio
Are you using your own theme? If not, check the functions. · What you should do is crop the image before uploading if...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found