luberda-molinet / FFImageLoading

Image loading, caching & transforming library for Xamarin and Windows
MIT License
1.42k stars 377 forks source link

SVG Image loading failed #1392

Open bnORISHA opened 4 years ago

bnORISHA commented 4 years ago

🐛 Bug Report

Some SVG's are not rendered. A exception is thrown : Image loading failed.

Image loading failed: resource://App1.Resources.package.svg?assembly=App1,%20Version=1.0.0.0,%20Culture=neutral,%20PublicKeyToken=null;(size=0x48,type=SvgDataResolver)
System.NullReferenceException: Object reference not set to an instance of an object.
  at FFImageLoading.Svg.Platform.SKSvg.ReadElement (System.Xml.Linq.XElement e, System.Collections.Generic.Dictionary`2[TKey,TValue] style) [0x0022e] in C:\projects\ffimageloading\source\FFImageLoading.Svg.Shared\SkSvg.cs:558 
  at FFImageLoading.Svg.Platform.SKSvg.ReadElement (System.Xml.Linq.XElement e, SkiaSharp.SKCanvas canvas, SkiaSharp.SKPaint stroke, SkiaSharp.SKPaint fill, System.Boolean isMask, System.Threading.CancellationToken token) [0x006d7] in C:\projects\ffimageloading\source\FFImageLoading.Svg.Shared\SkSvg.cs:343
  at FFImageLoading.Svg.Platform.SKSvg.LoadElements (System.Collections.Generic.IEnumerable`1[T] elements, SkiaSharp.SKCanvas canvas, SkiaSharp.SKPaint stroke, SkiaSharp.SKPaint fill, System.Threading.CancellationToken token) [0x00010] in C:\projects\ffimageloading\source\FFImageLoading.Svg.Shared\SkSvg.cs:221 
  at FFImageLoading.Svg.Platform.SKSvg.Load (System.Xml.Linq.XDocument xdoc, System.Threading.CancellationToken token) [0x00417] in C:\projects\ffimageloading\source\FFImageLoading.Svg.Shared\SkSvg.cs:209 
  at FFImageLoading.Svg.Platform.SKSvg.Load (System.Xml.XmlReader reader, System.Threading.CancellationToken token) [0x00000] in C:\projects\ffimageloading\source\FFImageLoading.Svg.Shared\SkSvg.cs:100 
  at FFImageLoading.Svg.Platform.SKSvg.Load (System.IO.Stream stream, System.Threading.CancellationToken token) [0x00012] in C:\projects\ffimageloading\source\FFImageLoading.Svg.Shared\SkSvg.cs:94 
  at FFImageLoading.Svg.Platform.SvgDataResolver.Resolve (System.String identifier, FFImageLoading.Work.TaskParameter parameters, System.Threading.CancellationToken token) [0x0019d] in C:\projects\ffimageloading\source\FFImageLoading.Svg.Shared\SvgDataResolver.cs:232 
  at FFImageLoading.DataResolvers.WrappedDataResolver.Resolve (System.String identifier, FFImageLoading.Work.TaskParameter parameters, System.Threading.CancellationToken token) [0x0004e] in C:\projects\ffimageloading\source\FFImageLoading.Common\DataResolvers\WrappedDataResolver.cs:21 
  at FFImageLoading.Work.ImageLoaderTask`3[TDecoderContainer,TImageContainer,TImageView].RunAsync () [0x00300] in C:\projects\ffimageloading\source\FFImageLoading.Common\Work\ImageLoaderTask.cs:618 

My other SVG's are correctly rendered. I use https://jakearchibald.github.io/svgomg/ to minimize SVG's.

Expected behavior

SVG should be rendered.

Reproduction steps

Place the SVG from zip in a folder Resources of the project package.zip XAML :

<ffimageloading:SvgCachedImage
 Source="resource://App1.Resources.package.svg" />

Configuration

Version: 2.4.11.982

Platform:

bnORISHA commented 4 years ago

Can someone help me about this ?

softsan commented 4 years ago

same issue here. @bnserig did you find any solution?

bnORISHA commented 4 years ago

No. I didn't find anything.

PS : Is this repository still active ? Because there is no release since May 2019.

softsan commented 4 years ago

@bnserig not sure. but I found similar issue here and the solution provided there worked for me.

bnORISHA commented 4 years ago

Well, this is not exactly the same error log. I tried to change my image package.svg to another name, but the result is the same.

BenBtg commented 3 years ago

I'm seeing the same issue with one of my svgs. Works fine for others. Tried minimising also.