TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN:Whats the problem with SVG?

23 pointsby lousy_sysadminover 12 years ago
I've been playing around with Inkscape for a while now to create vector image as its one of the easiest solution for Retina-esque site. However I'm having a hard time finding image hosting that support SVG.<p>My question is, why is it so hard for image hosting service to support native SVG, instead of converting an image to other format. Would like to hear the limitations and challenges that comes with it.<p>http://imgur.userecho.com/topic/23630-svg-support/

10 comments

jahewsonover 12 years ago
SVG implementations on browsers have historically been poor, though this is certainly improving. You'll hit many bugs and unsupported features. IE &#60; 9 doesn't support SVG at all, and Safari &#60; 6 only does so in XHTML. SVG fonts are sparsely supported. The alternative - rasterising SVG on the server - is a heavyweight task, I've not found any libraries which can do this quickly.<p>The worst problem may be SVG itself - SVG 1.2 which dates from 2004 was abandoned, and most browsers implement SVG 1.1 which is rather lacking in features. This makes it hard if you're a designer to produce SVG documents which a browser can actually render.<p>At a bare minimum any SVG hosting project would have to involve some sort of SVG lint, to make sure that browser-incompatible SVG elements are not present, implement workarounds for browser-specific bugs, and check that there are no &#60;script&#62; tags etc. The sheer size and complexity of even SVG 1.1 makes it non-trivial. One pragmatic approach to sanitize SVG may be to round-trip SVG -&#62; PDF -&#62; SVG via cairosvg and pdftocairo, though it may burn some CPU.
评论 #5129839 未加载
评论 #5124857 未加载
评论 #5128619 未加载
评论 #5124192 未加载
nwhover 12 years ago
I'd considered making one some time ago, but gave up when I realised that somebody had already purchased <a href="http://s.vg/" rel="nofollow">http://s.vg/</a>.
lmmover 12 years ago
XML being XML, it's hard-to-impossible to host SVG without allowing people to store arbitrary XML on your service, which sooner or later is going to be abused.
评论 #5124233 未加载
评论 #5124139 未加载
评论 #5124226 未加载
mbqover 12 years ago
_Arbitrary_ SVG is a security/privacy problem -- it may inject JS or exploit quirks in rendering to manipulate site contents, import external images and fonts, or simply be a render bomb. And it is hard to filter out those problems.
评论 #5123909 未加载
preover 12 years ago
It's not hard, probably the image hosts concerned merely didn't think to include it.<p>You can upload svg files with the right content type to Amazon S3 without trouble, is that not good enough?
youngtaffover 12 years ago
My question is why do you want to host your SVG images elsewhere?<p>If you just want to shop them you could convert them to bitmap or host them on GitHub<p>If you want to include them on your website, they're small and compress well with gzip so why have the complexity of relying on a third party services<p>It you have too much traffic to be able to host them yourself then you should look at something like a CDN e.g. Cloudfront, infront of S3
timrogersover 12 years ago
I'm guessing you could maybe host it with Gists, using the raw link? Although the content type headers might be an issue...
lsiebertover 12 years ago
It's not hard. However, I'd note that IE didn't have built in support until 2011, and the first browser with native svg support was Konqueror in 2004, whereas gif and jpeg have been around for a lot longer.<p>Isn't SVG just XML? I'd assume you could host it that way.
评论 #5123811 未加载
Turing_Machineover 12 years ago
You might look at <a href="http://openclipart.org/" rel="nofollow">http://openclipart.org/</a> to see how they're handling it.
wistyover 12 years ago
IE6. XML viruses.