rabidaudio / gulp-inline-image-html

Gulp task inlining images in HTML
MIT License
9 stars 8 forks source link

SVGs are been mimed as PNG #11

Open tefod-zz opened 3 years ago

tefod-zz commented 3 years ago

Hi, Mime-Type for SVG Images are been set to data:image/png instead of data:image/svg+xml Fix: In inline-images to object contentTypes following has to be added:

btw: it would be great, if the wrapper would also consider favicons (optionally) as well.

rabidaudio commented 3 years ago

Hi @tefod-zz . To your point, this functionality is missing from the upstream package, which this package is simply a lightweight wrapper around.

Normally I'd suggest you open an issue with that project. However there already seems to be an open PR there to add the functionality, but the project seems to be stale. (Admittedly, this project is a bit stale too, I'm not actively using it anymore but I'll do my best to continue to maintain it.)

If you or someone else wants to fork maxogden/inline-images with a more maintained version with this feature set, I'm happy to update this plugin to use it instead.

That being said, do you get much out of inlining SVGs in this way? This plugin inlines <img> tags using data URIs. But with SVGs you could also just render the content directly into your HTML, since <svg> is a valid HTML tag. I haven't looked but I suspect there's another plugin out there which will do this for you. I'd also accept a PR that adds that functionality to this plugin.

specious commented 2 years ago

Yep, pull request waiting: https://github.com/maxogden/inline-images/pull/4

The universe must conspire to get @maxogden to take a look.

tefod-zz commented 2 years ago

Your pull request is from 2017. I think you are putting too much pressure on him 😁