Fresco: Why don't support SVG

Created on 21 Feb 2016  ·  13Comments  ·  Source: facebook/fresco

???? Why don't support SVG ???

enhancement

Most helpful comment

He's definitely not the only one looking for SVG support. It would be nice if Fresco offered support for it. I had to migrate to Glide because I needed this feature.

All 13 comments

There's little use request for SVG so far. You may be the only one asking for this.

Yes, android just released new support v7 library.
And I used open source SVG library.
compile 'de.greenrobot:androidsvg:1.2.2-beta-1-tweaked-2'

Android Support Library, revision 23.2.0 (February 2016)
http://developer.android.com/tools/support-library/index.html
Adds support for VectorDrawable assets to apps running on API level 7 or higher. AnimatedVectorDrawable assets are also supported on API level 11 or higher. Vector assets can be considerably smaller than image assets and should help reduce app size by reducing the amount of assets required to support multiple device screens.

He's definitely not the only one looking for SVG support. It would be nice if Fresco offered support for it. I had to migrate to Glide because I needed this feature.

I use an animated vector drawable as the progressBarImage since vector drawable has been supported by the android support library, however, it seems that fresco doesn't support to use vector.

Please put this in the next sprint, much needed!

Android Studio have a tool, New->Vector Asset-> change the svg to vectordrawable, use appcompat v7 23.2.0 up, app:srcCompat="@drawable/vectordrawable" . So we can used svg to vectordrawable
Android Support Library, revision 23.2.0 (February 2016)
http://developer.android.com/tools/support-library/index.html

We currently have no plan in support SVG at the moment. We would appreciate if someone in community wants to contribute it.

You can use vector drawables from the support library. See #1176 for more information

As fresco doesn't have support for SVGs, vector drawables can't be used with React native as well. Had to convert many svgs into pngs in order to work with React native.

We're looking into adding custom decoders for Fresco so that you can add an SVG decoder if needed.

You can now add custom SVG decoders and drawable factories now. A very simple example how this could look like can be found here: https://github.com/facebook/fresco/tree/master/samples/showcase/src/main/java/com/facebook/fresco/samples/showcase/imageformat/svg

You can now add custom SVG decoders and drawable factories now. A very simple example how this could look like can be found here: https://github.com/facebook/fresco/tree/master/samples/showcase/src/main/java/com/facebook/fresco/samples/showcase/imageformat/svg

Can anyone tell how can we use this to show the svg image by using above reference link to SimpleDraweeView

You copy paste these 2 files and then hook it up when Fresco is initialized:

https://github.com/facebook/fresco/blob/master/samples/showcase/src/main/java/com/facebook/fresco/samples/showcase/CustomImageFormatConfigurator.java#L37

However, keep in mind that the SVG sample is quite basic and only detects tags, not

Was this page helpful?
0 / 5 - 0 ratings