Repository: flutter
Issue: [flutter_svg] Support SVG in `<image>` tag.
Labels: package,p: flutter_svg

_Imported from https://github.com/dnfield/flutter_svg/issues/267_

Original report by @ThinkDigitalSoftware on Dec 21, 2019

this error is thrown attempting to render this svg.
https://img.shields.io/github/stars/felangel/bloc.svg?style=flat&logo=github&colorB=deeppink&label=stars

### Code:
```dart
SvgPicture.network(
                    'https://img.shields.io/github/stars/felangel/bloc.svg?style=flat&logo=github&colorB=deeppink&label=stars');
```

### Exception
```
════════ Exception caught by SVG ═══════════════════════════════════════════════════════════════════
The following _Exception was thrown resolving a single-frame picture stream:
Exception: Could not instantiate image codec.

When the exception was thrown, this was the stack: 
#0      _futurize (dart:ui/painting.dart:4338:5)
#1      instantiateImageCodec (dart:ui/painting.dart:1718:10)
#2      resolveImage.<anonymous closure> (package:flutter_svg/src/svg/parsers.dart:204:31)
#3      resolveImage (package:flutter_svg/src/svg/parsers.dart:218:23)
#4      _Elements.image (package:flutter_svg/src/svg/parser_state.dart:443:31)
...
Picture provider: NetworkPicture("https://img.shields.io/github/stars/felangel/bloc.svg?style=flat&logo=github&colorB=deeppink&label=stars", headers: null, colorFilter: null)
Picture key: NetworkPicture("https://img.shields.io/github/stars/felangel/bloc.svg?style=flat&logo=github&colorB=deeppink&label=stars", headers: null, colorFilter: null)
```

---
Comment by @dnfield on Dec 21, 2019
This is using an `<image>` tag that actually has another SVG inside it.  

---
Comment by @ThinkDigitalSoftware on Dec 22, 2019
I thought that it was weird that the content type was image/svg. So what should I understand? That's its an SVG or that it's an Image? 

---
Comment by @ThinkDigitalSoftware on Dec 22, 2019
Oh, ok. So it's just something you need to support? 

---
Comment by @dnfield on Dec 22, 2019
Right

---
Comment by @ThinkDigitalSoftware on Dec 22, 2019
Ok,got it. Thanks! 

---
Comment by @ThinkDigitalSoftware on Dec 28, 2019
Having issues with this url as well.
https://img.shields.io/discord/649708778631200778.svg?logo=discord&color=blue

---
Comment by @jeiea on Mar 2, 2023
I'm experiencing the exact symptoms in the title, albeit with a different problem. I converted svg containing png as data url with `dart run vector_graphics_compiler -i`, the original svg was over 1MB and it only came out to 80kB.

---
Comment by @dnfield on Mar 3, 2023
> I'm experiencing the exact symptoms in the title, albeit with a different problem. I converted svg containing png as data url with `dart run vector_graphics_compiler -i`, the original svg was over 1MB and it only came out to 80kB.

Is it rendering correctly?

SVGs generally encode image data as base64. VG just stores the binary version of the image and saves a bit of space that way. @jeiea if you can share the SVG I'd be interested in seeing it. It's possible it had lots of other "noise" that VG strips out, but that'd be a lot more than I'd expect.

---
Comment by @jeiea on Mar 3, 2023
No, just picture is not shown..
https://fastupload.io/CznUYrI1JYEeT7N/file

---
Comment by @dnfield on Mar 3, 2023
That site does not work for me. Can you attach it to this issue?

---
Comment by @jeiea on Mar 3, 2023
.

---
Comment by @dnfield on Mar 3, 2023
Vector Graphics oly supports PNG images right now. Adding JPEG wouldn't be hard.