strues/retinajs

Must ignore .svg images as non-bitmap assets

nakonechny opened this issue · 4 comments

Many websites combine .png and .svg graphix for some reasons.
Retinajs when applied tryes to load @2x.svg. But that makes no sence. Leads to wasted requests.
Must totally ignore vector mime-types.

You can exclude svg images replacing line 42 in src/retina.js

original:

                    if (image.src) {

replaced:

                    if (image.src && !!!image.src.match(/\.svg$/i)) {

Definitely I can patch the code for my own use. And I did so. But other people should do the same, so i have opened this issue. Get it right.

Can't this be fixed? I mean I'd pull request it but you have the change right there. SVG obviously should be ignored.

Retina.js is no longer being maintained (last commit was over a year ago), and no maintainers are coming to the forefront, so I'd suggest you create a fork if you want a change.