jkphl / iconizr

A PHP command line tool for converting SVG images to a set of CSS icons (SVG & PNG, single icons and / or CSS sprites) with support for image optimization and Sass output. Created by Joschi Kuphal (@jkphl), licensed under the terms of the MIT license
http://iconizr.com
MIT License
485 stars 36 forks source link

Redundant data when using SVGs at multiple sizes #23

Closed fallenturtle closed 10 years ago

fallenturtle commented 10 years ago

Perhaps I'm just not using iconizr right, but it seems that if you have a situation where the same icon is used at different sizes throughout a website that you have to create a unique SVG for every size so that you also have the appropriately sized PNG fallbacks. But since SVGs cleanly scale it seems redundant to have their data repeated for every size that the icon will be used at. Is there a way to avoid that redundancy?

jkphl commented 10 years ago

Hey @fallenturtle,

no, you're not using iconizr wrong. You will have to embed the same SVG multiple times in these cases. In an automated solution like iconizr there's currently no way around, as iconizr doesn't "compare" the icons (or apply any other kind of logic). Considering file size, however, the effects of this redundancy will minimize to almost zero as you deliver your SVG sprite gzipped / deflated (and you do that anyway, right?!).

Cheers, Joschi