-
Notifications
You must be signed in to change notification settings - Fork 70
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
Large SVG #3
Comments
I can reproduce the issue but have no idea what is causing it. Will update here once I find the issue that is causing this and fix it. |
@seekshiva |
Any updates on this @seekshiva |
Yes. This is the issue. It doesn't seem to be about the size of the svg file. There are some very detailed svg images I've used that are of larger size. I've not faced issue with them. Something else seems to be wrong about these particular set of images that is not linked to the file size. Usually when I face issue like this, adding a |
@seekshiva We define the code, the code doesn't define us. |
@sirjmkitavi Good idea! For starters, these images don't fit to screen when you load it in a browser. Check here for difference between how a normal image behaves vs the image that we are facing issue with: When you open an image uri directly in browser
These two behaviour are not noticed when you load the above svg. Browser is not able to fit it to screen and doesn't provide a zoom in/out cursor when you hover over the image. This library works by loading svg image in a WebView with transparent bg. WebView in turn just loads a web browser. When someone using this component says that some svg image needs to load in 50x50 px or 100x100 px, it just loads a WebView of that size, and asks it to fit all content inside the web browser. By default, the browser is able to resize the image and show it in the size that we define. But in certain images, the browser itself is not able to perform a "fit to screen" functionality. |
these are the images I used in the demo:
|
Ah, sorry. wait.. the first image used in demo is actually a png. But the issue still stands that the reason this image doesn't get rendered within the bounding area is because browser is not able to perform "fit to screen" on it. If the issue is as simple as adding a |
@sirjmkitavi If we are able to mutate the various tags in svg and somehow get it to work, then that would be a good step towards figuring out the issue with these images. Thanks! |
I have same problem, i have use this plugin for display PNG/SVG whit API (http://api.football-data.org/v1/competitions/450/leagueTable) but 5 SVG no display... to large. |
@seekshiva Thanks for the insights. |
News ? |
I modified the svg style's width and height -import React, { useEffect, useState } from "react"; const heightUnits = Platform.OS === "ios" ? "vh" : "%"; const getHTML = (svgContent, style) => ` |
Hello.
Thanks A lot for the library. I have experienced a slight problem when trying to display large SVG images.
Use this example to try and replicate:
https://upload.wikimedia.org/wikipedia/de/d/da/Manchester_United_FC.svg
The text was updated successfully, but these errors were encountered: