1
0
mirror of https://github.com/svg/svgo.git synced 2025-07-29 20:21:14 +03:00

plugins/removeRasterImages: add gif format

This commit is contained in:
deepsweet
2013-02-13 17:24:25 +02:00
parent 7ddc8ebbc0
commit f944a2af57
3 changed files with 3 additions and 1 deletions

View File

@ -15,7 +15,7 @@ exports.removeRasterImages = function(item) {
if (
item.isElem('image') &&
item.hasAttr('xlink:href') &&
/(\.|image\/)(jpg|png)/.test(item.attr('xlink:href').value)
/(\.|image\/)(jpg|png|gif)/.test(item.attr('xlink:href').value)
) {
return false;
}

View File

@ -2,6 +2,7 @@
<g>
<image xlink:href="raster.jpg" width="100" height="100"/>
<image xlink:href="raster.png" width="100" height="100"/>
<image xlink:href="raster.gif" width="100" height="100"/>
<image xlink:href="raster.svg" width="100" height="100"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 306 B

After

Width:  |  Height:  |  Size: 372 B

View File

@ -2,6 +2,7 @@
<g>
<image xlink:href="data:image/jpg;base64,..." width="100" height="100"/>
<image xlink:href="data:image/png;base64,..." width="100" height="100"/>
<image xlink:href="data:image/gif;base64,..." width="100" height="100"/>
<image xlink:href="data:image/svg+xml;base64,..." width="100" height="100"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 355 B

After

Width:  |  Height:  |  Size: 436 B