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.

Cannot display SVG image

See original GitHub issue

Description

I am trying to use the SvgCachedImage to display a SVG image. However, it’s not displaying for some odd reason. When I try with a PNG image it works fine. I am trying to do it in Xamarin.Forms. This is the code snippet:

<ffimageloadingsvg:SvgCachedImage HeightRequest="48" WidthRequest="48" Source="backbutton.svg"> <ffimageloadingsvg:SvgCachedImage.GestureRecognizers> <TapGestureRecognizer Tapped="OnBackButtonPressed" /> </ffimageloadingsvg:SvgCachedImage.GestureRecognizers> </ffimageloadingsvg:SvgCachedImage>

I have installed the nuget plugin, and I do have xmlns:ffimageloadingsvg="clr-namespace:FFImageLoading.Svg.Forms;assembly=FFImageLoading.Svg.Forms"

I have tried with two different SVG images.

Expected Behavior

The SVG image is displayed

Actual Behavior

The SVG image is not displayed

Basic Information

  • Version with issue: 2.3.3

  • Platform: Xamarin.Forms

Reproduction Link / Code

<ffimageloadingsvg:SvgCachedImage HeightRequest="48" WidthRequest="48" Source="backbutton.svg"> <ffimageloadingsvg:SvgCachedImage.GestureRecognizers> <TapGestureRecognizer Tapped="OnBackButtonPressed" /> </ffimageloadingsvg:SvgCachedImage.GestureRecognizers> </ffimageloadingsvg:SvgCachedImage>

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
daniel-luberdacommented, Jan 8, 2018

I did some measures recently and it’s almost the same (sometimes even faster). SVG files are smaller in size, so reading stream from assets is a lot faster, leading to similar loading time. After image is decoded it’s cached as any other image. There could be a performance issue for a really large and complex SVG files when decoding though.

BTW: I use SVG’s in almost all projects, it’s such a time saver.

0reactions
daniel-luberdacommented, Jan 8, 2018

I updated samples to also replace colors. You can also use regex as mentioned here: https://github.com/luberda-molinet/FFImageLoading/wiki/SVG-support#svg-string-replacement-including-colors

Read more comments on GitHub >

github_iconTop Results From Across the Web

Images in SVG Image tags not showing up in Chrome, but ...
Images in SVG Image tags not showing up in Chrome, but displays locally? For some reason, Chrome is displaying the SVG without the...
Read more >
Serve SVG with the Correct Content Type
SVG image was not showing on Website hosted on 1und1 Webserver. Entering “AddType…” into .htaccess solved the problem!
Read more >
SVG image isn't displaying in Chrome browser - W3 Mind
Peoples are facing issues that they aren't able to see their images in Chrome browser because the images are in SVG format. So...
Read more >
SVG image not displaying properly in HTML webpage
I'm trying to insert an svg image that I created in Inkscape into my html web page but for some reason I can't...
Read more >
Image and svg not loading on page - HTML-CSS
I have checked the file path and file type everything is ok. It outputs the alt attribute but not the image itself. it...
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