You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some SVG files will open fine in a lightbox; others will collapse to a 0x0 image. I'm not sure what it is that makes the difference, but it may be related to viewbox or height/width attributes in the SVG itself. The behaviour does not seem to be consistent across browsers. In the example below, Firefox 49 and IE11 will collapse the left image, IE collapses both, and Chrome 53 and 54 work fine. I have not tested in other browsers.
Lightbox version: 2.9.0 Reproduced in:
Firefox 49.0.2, Windows 7
IE11, Windows 7
To reproduce:
Create a lightbox-enabled link to an SVG image (I think there is a particular quality of the image that matters, but I don't know what it is)
Click the link to open the lightbox
Example:https://jsfiddle.net/Lj7cfnkL/9/ . The left-hand image is SVG and does not work as expected. The centre image is SVG and does work as expected. The right-hand image is PNG.
The text was updated successfully, but these errors were encountered:
Pilchard123
changed the title
Some SVGs display as 0x0
Some SVGs display as 0x0 image
Oct 31, 2016
Here's a patch that fixes it. This is against 2.10.0 source, but I have only tested it on 2.9.0.
The culprit is that some svgs report 0x0 size, so we just display them with maximum size. lightbox-fix-for-0-size-svgs.zip
Github doesn't allow attaching *.patch files? How strange.
Some SVG files will open fine in a lightbox; others will collapse to a 0x0 image. I'm not sure what it is that makes the difference, but it may be related to viewbox or height/width attributes in the SVG itself. The behaviour does not seem to be consistent across browsers. In the example below, Firefox 49 and IE11 will collapse the left image, IE collapses both, and Chrome 53 and 54 work fine. I have not tested in other browsers.
Lightbox version: 2.9.0
Reproduced in:
To reproduce:
Example: https://jsfiddle.net/Lj7cfnkL/9/ . The left-hand image is SVG and does not work as expected. The centre image is SVG and does work as expected. The right-hand image is PNG.
The text was updated successfully, but these errors were encountered: