Size (ratio) of image preview is incorrect
See original GitHub issueHi,
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:
- Created 10 years ago
- Comments:32 (1 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This problem looks similar to the bootstrap issue.
Please try adding the following to your CSS: .lb-image{ max-width: inherit; }
however the lightbox currently lacks a window resize event. Please make sure the lightbox scales correctly when the window is resized.
pls help me.