{"id":4991,"date":"2009-12-20T12:06:39","date_gmt":"2009-12-20T17:06:39","guid":{"rendered":"http:\/\/scruss.com\/blog\/?p=4991"},"modified":"2010-02-05T22:52:43","modified_gmt":"2010-02-06T03:52:43","slug":"i-want-my-svg","status":"publish","type":"post","link":"https:\/\/scruss.com\/blog\/2009\/12\/20\/i-want-my-svg\/","title":{"rendered":"i want my svg"},"content":{"rendered":"<p>Look, <a href=\"http:\/\/www.w3.org\/TR\/SVG10\/\">SVG has been the cool graphics format since 2001<\/a>. And while WordPress now supports a bunch more <a href=\"http:\/\/codex.wordpress.org\/Embeds\">embed<\/a> formats, you&#8217;d think it&#8217;d work. Nope.<\/p>\n<p>Even to upload an SVG file, I have to bypass WordPress&#8217;s built in whitelist using <a href=\"http:\/\/wordpress.org\/extend\/plugins\/pjw-mime-config\/\">PJW Mime Config<\/a>, and manually add support for image\/svg+xml. Otherwise, it&#8217;s refused as an insecure file. (All my files are quite well adjusted, I&#8217;ll have you know.)<\/p>\n<p>Say if I want to embed <a href=\"http:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2009\/12\/ford_script_fnord-plain.svg\">this SVG image<\/a>. I&#8217;d probably want to do something like:<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;embed type=&quot;image\/svg+xml&quot; width=&quot;100&quot; title=&quot;ford_script_fnord-plain&quot; src=&quot;http:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2009\/12\/ford_script_fnord-plain.svg&quot; \/&gt;\r\n<\/pre>\n<p>But this doesn&#8217;t end up being what the final code says:<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;object classid=&quot;clsid:d27cdb6e-ae6d-11cf-96b8-444553540000&quot; width=&quot;100&quot; height=&quot;100&quot; codebase=&quot;http:\/\/download.macromedia.com\/pub\/shockwave\/cabs\/flash\/swflash.cab#version=6,0,40,0&quot;&gt;&lt;param name=&quot;src&quot; value=&quot;http:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2009\/12\/ford_script_fnord-plain.svg&quot; \/&gt;&lt;embed type=&quot;application\/x-shockwave-flash&quot; width=&quot;100&quot; height=&quot;100&quot; src=&quot;http:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2009\/12\/ford_script_fnord-plain.svg&quot;&gt;&lt;\/embed&gt;&lt;\/object&gt;\r\n<\/pre>\n<p>If I&#8217;d wanted Flash, I&#8217;d have asked for it.  <span style=\"font-variant: small-caps;\">Do What <span style=\"text-decoration: underline;\">I<\/span> <strong>Mean<\/strong>, Little Computer!<\/span><\/p>\n<p><strong>Update<\/strong> (after the comment below): Okay, last try:<br \/>\n<object type=\"image\/svg+xml\" width=\"220\" height=\"72\" title=\"ford_script_fnord-plain\" data=\"http:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2009\/12\/ford_script_fnord-plain.svg\" \/><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">&lt;object type=&quot;image\/svg+xml&quot; width=&quot;220&quot; height=&quot;72&quot; title=&quot;ford_script_fnord-plain&quot; data=&quot;http:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2009\/12\/ford_script_fnord-plain.svg&quot; \/&gt;<\/pre>\n<p>Yay, that sorta works &#8211; but it doesn&#8217;t scale the image. You know what the S in SVG stands for? That&#8217;s right &#8211; <span style=\"font-variant: small-caps;\">Scalable<\/span>. Doesn&#8217;t seem to allow scaling. Kinda defeats the purpose, doesn&#8217;t it?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Look, SVG has been the cool graphics format since 2001. And while WordPress now supports a bunch more embed formats, you&#8217;d think it&#8217;d work. Nope. Even to upload an SVG file, I have to bypass WordPress&#8217;s built in whitelist using PJW Mime Config, and manually add support for image\/svg+xml. Otherwise, it&#8217;s refused as an insecure [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[7],"tags":[1855,49],"class_list":["post-4991","post","type-post","status-publish","format-standard","hentry","category-computers-suck","tag-svg","tag-wordpress"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pQNZZ-1iv","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts\/4991","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/comments?post=4991"}],"version-history":[{"count":20,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts\/4991\/revisions"}],"predecessor-version":[{"id":5003,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts\/4991\/revisions\/5003"}],"wp:attachment":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/media?parent=4991"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/categories?post=4991"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/tags?post=4991"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}