Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: When displaying SVGs, max out their size #684

Merged
merged 2 commits into from
Jul 7, 2020
Merged

feat: When displaying SVGs, max out their size #684

merged 2 commits into from
Jul 7, 2020

Conversation

lokesh
Copy link
Owner

@lokesh lokesh commented Jul 4, 2020

SVGs are often constructed to be scaled up and down to various sizes, and since SVGs are a primarily vector format, they can be scaled up and down without quality loss. Many of these SVG files are constructed w/o consideration of the viewbox dimensions. Some are tiny, and some are massive. When they are rendered on a site, these intrinsic dimensions don't matter much, as they are almost always resized for the layout context (e.g. svg { width: 100%; }).

How does this affect Lightbox? When using SVGs with Lightbox, we are seeing some files render very tiny. This is because of their small intrinsic dimensions.
image

To resolve this issue, when an SVG is loaded in Lightbox, rather than reading the width and height, we max out the image in the viewport.


#681

@davidc Considering this update to resolve your issue.

@davidc
Copy link

davidc commented Jul 4, 2020

Tested & confirmed fixes #681, thank you.

@lokesh lokesh merged commit 7734213 into master Jul 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants