mapbox / spritezero

small opinionated sprites
Other
173 stars 63 forks source link

Add failing test for SVG without width/height #16

Closed tmcw closed 9 years ago

tmcw commented 9 years ago

@peterqliu can't use Illustrator-generated SVG files with spritezero because Mapnik's SVG rasterizer requires width & height attributes of the svg element, but Illustrator exports only viewBox.

@flippmoke is it possible for Mapnik to support this kind of SVG input? Unfortunately with Illustrator's popularity there are probably many SVG files like this.

nickidlugash commented 9 years ago

@tmcw @peterqliu FYI AI does export with width and height attributes. When saving as an svg, uncheck the box "responsive" – by default, AI has this box checked, which doesn't create the width and height attributes so that you can use responsive svgs on the web.

flippmoke commented 9 years ago

How do you determine the size of the image to create with out a width and height @tmcw ? I am not sure we will ever have a good answer to this question?

peterqliu commented 9 years ago

How do you determine the size of the image to create with out a width and height

@flippmoke could be a slippery slope, but can we deduce this from viewBox as a fallback?

jakepruitt commented 9 years ago

@tmcw working now with mapnik update!

tmcw commented 9 years ago

:raised_hands:

peterqliu commented 9 years ago

thanks so much for this @jakepruitt