{"action":"created","comment":{"url":"https://api.github.com/repos/thoughtbot/paperclip/pulls/comments/33747068","id":33747068,"diff_hunk":"@@ -73,6 +73,71 @@\n \n   end\n \n+  context \"an svg image\" do\n+    context \"base64 encoded\" do\n+      before do\n+        @contents = \"data:image/svg+xml;base64,#{svg_base64_content}\"\n+        @subject = Paperclip.io_adapters.for(@contents)\n+      end\n+      it \"returns a nondescript file name\" do\n+        assert_equal \"data\", @subject.original_filename\n+      end\n+\n+      it \"returns a content type\" do\n+        assert_equal \"image/svg+xml\", @subject.content_type\n+      end\n+      it \"generates correct fingerprint after read\" do\n+        fingerprint = Digest::MD5.hexdigest(@subject.read)\n+        assert_equal fingerprint, @subject.fingerprint\n+      end\n+\n+      it \"generates same fingerprint\" do\n+        assert_equal @subject.fingerprint, @subject.fingerprint\n+      end\n+\n+      it 'accepts a content_type' do\n+        @subject.content_type = 'image/svg+xml'\n+        assert_equal 'image/svg+xml', @subject.content_type\n+      end\n+\n+      it 'accepts an original_filename' do\n+        @subject.original_filename = 'image.svg'\n+        assert_equal 'image.svg', @subject.original_filename","path":"spec/paperclip/io_adapters/data_uri_adapter_spec.rb","position":42,"original_position":42,"commit_id":"36805f42fb691eb995dea34f164867b23058ae24","original_commit_id":"36805f42fb691eb995dea34f164867b23058ae24","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.","created_at":"2015-07-02T04:46:26Z","updated_at":"2015-07-02T04:46:26Z","html_url":"https://github.com/thoughtbot/paperclip/pull/1918#discussion_r33747068","pull_request_url":"https://api.github.com/repos/thoughtbot/paperclip/pulls/1918","_links":{"self":{"href":"https://api.github.com/repos/thoughtbot/paperclip/pulls/comments/33747068"},"html":{"href":"https://github.com/thoughtbot/paperclip/pull/1918#discussion_r33747068"},"pull_request":{"href":"https://api.github.com/repos/thoughtbot/paperclip/pulls/1918"}}},"pull_request":{"url":"https://api.github.com/repos/thoughtbot/paperclip/pulls/1918","id":39047987,"html_url":"https://github.com/thoughtbot/paperclip/pull/1918","diff_url":"https://github.com/thoughtbot/paperclip/pull/1918.diff","patch_url":"https://github.com/thoughtbot/paperclip/pull/1918.patch","issue_url":"https://api.github.com/repos/thoughtbot/paperclip/issues/1918","number":1918,"state":"open","locked":false,"title":"Can now handle data svg","user":{"login":"davidrivera","id":1133969,"avatar_url":"https://avatars.githubusercontent.com/u/1133969?v=3","gravatar_id":"","url":"https://api.github.com/users/davidrivera","html_url":"https://github.com/davidrivera","followers_url":"https://api.github.com/users/davidrivera/followers","following_url":"https://api.github.com/users/davidrivera/following{/other_user}","gists_url":"https://api.github.com/users/davidrivera/gists{/gist_id}","starred_url":"https://api.github.com/users/davidrivera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidrivera/subscriptions","organizations_url":"https://api.github.com/users/davidrivera/orgs","repos_url":"https://api.github.com/users/davidrivera/repos","events_url":"https://api.github.com/users/davidrivera/events{/privacy}","received_events_url":"https://api.github.com/users/davidrivera/received_events","type":"User","site_admin":false},"body":"This addresses #1884 and my own issue which is that svg's encoded in base64 then getting sent to the server were causing the following error:\r\n\r\n```\r\nno decode delegate for this image format `' @ error/constitute.c/ReadImage/501.\r\n```\r\n\r\nafter some digging i found that svg's needed to be prepended with the \r\n```xml\r\n<?xml version=\"1.0\" standalone=\"yes\"?>\r\n```\r\nheader in order to be valid. I claim to be no expert on this at all, this just comes from my initial research on the subject and that these changes fixed the issues I was experiencing, so any and all critiques are welcome. Keep up the awesome work thoughtbot you guys are some of the more badass rails devs :100: ","created_at":"2015-07-02T04:46:21Z","updated_at":"2015-07-02T04:46:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a73f501df53e4440e738a8d5923960c162586f90","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/thoughtbot/paperclip/pulls/1918/commits","review_comments_url":"https://api.github.com/repos/thoughtbot/paperclip/pulls/1918/comments","review_comment_url":"https://api.github.com/repos/thoughtbot/paperclip/pulls/comments{/number}","comments_url":"https://api.github.com/repos/thoughtbot/paperclip/issues/1918/comments","statuses_url":"https://api.github.com/repos/thoughtbot/paperclip/statuses/36805f42fb691eb995dea34f164867b23058ae24","head":{"label":"davidrivera:master","ref":"master","sha":"36805f42fb691eb995dea34f164867b23058ae24","user":{"login":"davidrivera","id":1133969,"avatar_url":"https://avatars.githubusercontent.com/u/1133969?v=3","gravatar_id":"","url":"https://api.github.com/users/davidrivera","html_url":"https://github.com/davidrivera","followers_url":"https://api.github.com/users/davidrivera/followers","following_url":"https://api.github.com/users/davidrivera/following{/other_user}","gists_url":"https://api.github.com/users/davidrivera/gists{/gist_id}","starred_url":"https://api.github.com/users/davidrivera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidrivera/subscriptions","organizations_url":"https://api.github.com/users/davidrivera/orgs","repos_url":"https://api.github.com/users/davidrivera/repos","events_url":"https://api.github.com/users/davidrivera/events{/privacy}","received_events_url":"https://api.github.com/users/davidrivera/received_events","type":"User","site_admin":false},"repo":{"id":38404906,"name":"paperclip","full_name":"davidrivera/paperclip","owner":{"login":"davidrivera","id":1133969,"avatar_url":"https://avatars.githubusercontent.com/u/1133969?v=3","gravatar_id":"","url":"https://api.github.com/users/davidrivera","html_url":"https://github.com/davidrivera","followers_url":"https://api.github.com/users/davidrivera/followers","following_url":"https://api.github.com/users/davidrivera/following{/other_user}","gists_url":"https://api.github.com/users/davidrivera/gists{/gist_id}","starred_url":"https://api.github.com/users/davidrivera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidrivera/subscriptions","organizations_url":"https://api.github.com/users/davidrivera/orgs","repos_url":"https://api.github.com/users/davidrivera/repos","events_url":"https://api.github.com/users/davidrivera/events{/privacy}","received_events_url":"https://api.github.com/users/davidrivera/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/davidrivera/paperclip","description":"Easy file attachment management for ActiveRecord","fork":true,"url":"https://api.github.com/repos/davidrivera/paperclip","forks_url":"https://api.github.com/repos/davidrivera/paperclip/forks","keys_url":"https://api.github.com/repos/davidrivera/paperclip/keys{/key_id}","collaborators_url":"https://api.github.com/repos/davidrivera/paperclip/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/davidrivera/paperclip/teams","hooks_url":"https://api.github.com/repos/davidrivera/paperclip/hooks","issue_events_url":"https://api.github.com/repos/davidrivera/paperclip/issues/events{/number}","events_url":"https://api.github.com/repos/davidrivera/paperclip/events","assignees_url":"https://api.github.com/repos/davidrivera/paperclip/assignees{/user}","branches_url":"https://api.github.com/repos/davidrivera/paperclip/branches{/branch}","tags_url":"https://api.github.com/repos/davidrivera/paperclip/tags","blobs_url":"https://api.github.com/repos/davidrivera/paperclip/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/davidrivera/paperclip/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/davidrivera/paperclip/git/refs{/sha}","trees_url":"https://api.github.com/repos/davidrivera/paperclip/git/trees{/sha}","statuses_url":"https://api.github.com/repos/davidrivera/paperclip/statuses/{sha}","languages_url":"https://api.github.com/repos/davidrivera/paperclip/languages","stargazers_url":"https://api.github.com/repos/davidrivera/paperclip/stargazers","contributors_url":"https://api.github.com/repos/davidrivera/paperclip/contributors","subscribers_url":"https://api.github.com/repos/davidrivera/paperclip/subscribers","subscription_url":"https://api.github.com/repos/davidrivera/paperclip/subscription","commits_url":"https://api.github.com/repos/davidrivera/paperclip/commits{/sha}","git_commits_url":"https://api.github.com/repos/davidrivera/paperclip/git/commits{/sha}","comments_url":"https://api.github.com/repos/davidrivera/paperclip/comments{/number}","issue_comment_url":"https://api.github.com/repos/davidrivera/paperclip/issues/comments{/number}","contents_url":"https://api.github.com/repos/davidrivera/paperclip/contents/{+path}","compare_url":"https://api.github.com/repos/davidrivera/paperclip/compare/{base}...{head}","merges_url":"https://api.github.com/repos/davidrivera/paperclip/merges","archive_url":"https://api.github.com/repos/davidrivera/paperclip/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/davidrivera/paperclip/downloads","issues_url":"https://api.github.com/repos/davidrivera/paperclip/issues{/number}","pulls_url":"https://api.github.com/repos/davidrivera/paperclip/pulls{/number}","milestones_url":"https://api.github.com/repos/davidrivera/paperclip/milestones{/number}","notifications_url":"https://api.github.com/repos/davidrivera/paperclip/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/davidrivera/paperclip/labels{/name}","releases_url":"https://api.github.com/repos/davidrivera/paperclip/releases{/id}","created_at":"2015-07-02T01:45:26Z","updated_at":"2015-07-02T01:45:30Z","pushed_at":"2015-07-02T04:38:40Z","git_url":"git://github.com/davidrivera/paperclip.git","ssh_url":"git@github.com:davidrivera/paperclip.git","clone_url":"https://github.com/davidrivera/paperclip.git","svn_url":"https://github.com/davidrivera/paperclip","homepage":"https://thoughtbot.com/open-source","size":10382,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"thoughtbot:master","ref":"master","sha":"b417ed8871346aacabd959edd0585d7ca9f39e9c","user":{"login":"thoughtbot","id":6183,"avatar_url":"https://avatars.githubusercontent.com/u/6183?v=3","gravatar_id":"","url":"https://api.github.com/users/thoughtbot","html_url":"https://github.com/thoughtbot","followers_url":"https://api.github.com/users/thoughtbot/followers","following_url":"https://api.github.com/users/thoughtbot/following{/other_user}","gists_url":"https://api.github.com/users/thoughtbot/gists{/gist_id}","starred_url":"https://api.github.com/users/thoughtbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thoughtbot/subscriptions","organizations_url":"https://api.github.com/users/thoughtbot/orgs","repos_url":"https://api.github.com/users/thoughtbot/repos","events_url":"https://api.github.com/users/thoughtbot/events{/privacy}","received_events_url":"https://api.github.com/users/thoughtbot/received_events","type":"Organization","site_admin":false},"repo":{"id":8393,"name":"paperclip","full_name":"thoughtbot/paperclip","owner":{"login":"thoughtbot","id":6183,"avatar_url":"https://avatars.githubusercontent.com/u/6183?v=3","gravatar_id":"","url":"https://api.github.com/users/thoughtbot","html_url":"https://github.com/thoughtbot","followers_url":"https://api.github.com/users/thoughtbot/followers","following_url":"https://api.github.com/users/thoughtbot/following{/other_user}","gists_url":"https://api.github.com/users/thoughtbot/gists{/gist_id}","starred_url":"https://api.github.com/users/thoughtbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thoughtbot/subscriptions","organizations_url":"https://api.github.com/users/thoughtbot/orgs","repos_url":"https://api.github.com/users/thoughtbot/repos","events_url":"https://api.github.com/users/thoughtbot/events{/privacy}","received_events_url":"https://api.github.com/users/thoughtbot/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/thoughtbot/paperclip","description":"Easy file attachment management for ActiveRecord","fork":false,"url":"https://api.github.com/repos/thoughtbot/paperclip","forks_url":"https://api.github.com/repos/thoughtbot/paperclip/forks","keys_url":"https://api.github.com/repos/thoughtbot/paperclip/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thoughtbot/paperclip/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thoughtbot/paperclip/teams","hooks_url":"https://api.github.com/repos/thoughtbot/paperclip/hooks","issue_events_url":"https://api.github.com/repos/thoughtbot/paperclip/issues/events{/number}","events_url":"https://api.github.com/repos/thoughtbot/paperclip/events","assignees_url":"https://api.github.com/repos/thoughtbot/paperclip/assignees{/user}","branches_url":"https://api.github.com/repos/thoughtbot/paperclip/branches{/branch}","tags_url":"https://api.github.com/repos/thoughtbot/paperclip/tags","blobs_url":"https://api.github.com/repos/thoughtbot/paperclip/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thoughtbot/paperclip/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thoughtbot/paperclip/git/refs{/sha}","trees_url":"https://api.github.com/repos/thoughtbot/paperclip/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thoughtbot/paperclip/statuses/{sha}","languages_url":"https://api.github.com/repos/thoughtbot/paperclip/languages","stargazers_url":"https://api.github.com/repos/thoughtbot/paperclip/stargazers","contributors_url":"https://api.github.com/repos/thoughtbot/paperclip/contributors","subscribers_url":"https://api.github.com/repos/thoughtbot/paperclip/subscribers","subscription_url":"https://api.github.com/repos/thoughtbot/paperclip/subscription","commits_url":"https://api.github.com/repos/thoughtbot/paperclip/commits{/sha}","git_commits_url":"https://api.github.com/repos/thoughtbot/paperclip/git/commits{/sha}","comments_url":"https://api.github.com/repos/thoughtbot/paperclip/comments{/number}","issue_comment_url":"https://api.github.com/repos/thoughtbot/paperclip/issues/comments{/number}","contents_url":"https://api.github.com/repos/thoughtbot/paperclip/contents/{+path}","compare_url":"https://api.github.com/repos/thoughtbot/paperclip/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thoughtbot/paperclip/merges","archive_url":"https://api.github.com/repos/thoughtbot/paperclip/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thoughtbot/paperclip/downloads","issues_url":"https://api.github.com/repos/thoughtbot/paperclip/issues{/number}","pulls_url":"https://api.github.com/repos/thoughtbot/paperclip/pulls{/number}","milestones_url":"https://api.github.com/repos/thoughtbot/paperclip/milestones{/number}","notifications_url":"https://api.github.com/repos/thoughtbot/paperclip/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thoughtbot/paperclip/labels{/name}","releases_url":"https://api.github.com/repos/thoughtbot/paperclip/releases{/id}","created_at":"2008-04-10T19:58:20Z","updated_at":"2015-07-02T03:04:41Z","pushed_at":"2015-07-02T04:46:21Z","git_url":"git://github.com/thoughtbot/paperclip.git","ssh_url":"git@github.com:thoughtbot/paperclip.git","clone_url":"https://github.com/thoughtbot/paperclip.git","svn_url":"https://github.com/thoughtbot/paperclip","homepage":"https://thoughtbot.com/open-source","size":10382,"stargazers_count":7047,"watchers_count":7047,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1542,"mirror_url":null,"open_issues_count":107,"forks":1542,"open_issues":107,"watchers":7047,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/thoughtbot/paperclip/pulls/1918"},"html":{"href":"https://github.com/thoughtbot/paperclip/pull/1918"},"issue":{"href":"https://api.github.com/repos/thoughtbot/paperclip/issues/1918"},"comments":{"href":"https://api.github.com/repos/thoughtbot/paperclip/issues/1918/comments"},"review_comments":{"href":"https://api.github.com/repos/thoughtbot/paperclip/pulls/1918/comments"},"review_comment":{"href":"https://api.github.com/repos/thoughtbot/paperclip/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/thoughtbot/paperclip/pulls/1918/commits"},"statuses":{"href":"https://api.github.com/repos/thoughtbot/paperclip/statuses/36805f42fb691eb995dea34f164867b23058ae24"}}}}