SDWebImage/SDWebImageSVGNativeCoder

image default Color is black

iPermanent opened this issue · 6 comments

After change the SVGKit to this lib, the image that show with white background color now display black bg, so can this lib open a interface or property to set the default color?

Emmmm

It sounds configuable for the internal SVG-Native codec.

I'll check their API and change the default color to White, which may suitable for most mobile cases.

@iPermanent Can you please provide a sample SVG for me to test ?

vvvvv
Here I attached it, in my project, I load it with url, and with sdwebimage to show the svg,url is https://preview.yutangim.cn/avatar/vvvvv?custom=true&color=F6303A

It not the background color.

The current Adobe's svg-native, seems can not parse when an <use> reference another root node inside <defs>

Your SVG looks like:

<defs>
	<circle id="path-1" cx="100" cy="100" r="100"></circle>
</defs>
<use fill-opacity="0.05" fill="#2196F3" xlink:href="#path-1"></use>

Which should be parsed as such a node:

<circle id="path-1" cx="100" cy="100" r="100" fill-opacity="0.05" fill="#2196F3"></circle>

We can fire issue to Adobe's svg-native first.

For workaround, just change the SVG into this type, without those usage combined with defs and use


Fired adobe/svg-native-viewer#182

Please use v0.2.0 to test again.

Close fow now. Feel free to re-open if you need.