{"action":"created","issue":{"url":"https://api.github.com/repos/minad/mimemagic/issues/29","labels_url":"https://api.github.com/repos/minad/mimemagic/issues/29/labels{/name}","comments_url":"https://api.github.com/repos/minad/mimemagic/issues/29/comments","events_url":"https://api.github.com/repos/minad/mimemagic/issues/29/events","html_url":"https://github.com/minad/mimemagic/issues/29","id":122274225,"number":29,"title":"Misdetection of CSV file mime-type","user":{"login":"jastkand","id":1298360,"avatar_url":"https://avatars.githubusercontent.com/u/1298360?v=3","gravatar_id":"","url":"https://api.github.com/users/jastkand","html_url":"https://github.com/jastkand","followers_url":"https://api.github.com/users/jastkand/followers","following_url":"https://api.github.com/users/jastkand/following{/other_user}","gists_url":"https://api.github.com/users/jastkand/gists{/gist_id}","starred_url":"https://api.github.com/users/jastkand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jastkand/subscriptions","organizations_url":"https://api.github.com/users/jastkand/orgs","repos_url":"https://api.github.com/users/jastkand/repos","events_url":"https://api.github.com/users/jastkand/events{/privacy}","received_events_url":"https://api.github.com/users/jastkand/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-15T13:36:53Z","updated_at":"2016-01-05T08:00:52Z","closed_at":"2016-01-04T19:52:22Z","body":"I'm using paperclip gem which uses mimemagic gem for mime-type detection. I have the problem with detection of mime-type of CSV file type. The content of the file is like this\r\n\r\n```csv\r\ncandidate_id,email\r\n1,some@email.com\r\n```\r\n\r\nThe mime-type of a file with such content is misdetected with `image/x-quicktime` because of this rule https://github.com/minad/mimemagic/blob/master/lib/mimemagic/tables.rb#L1717\r\n\r\nAs we can see the rule defines to return `image/x-quicktime` if the file has `idat` pattern on the 4th position of the file. Can we fix this somehow?\r\n\r\nFor now as a temporary workaround I have just removed this type in initializer file\r\n\r\n```ruby\r\nMimeMagic.remove('image/x-quicktime')\r\n```"},"comment":{"url":"https://api.github.com/repos/minad/mimemagic/issues/comments/168929451","html_url":"https://github.com/minad/mimemagic/issues/29#issuecomment-168929451","issue_url":"https://api.github.com/repos/minad/mimemagic/issues/29","id":168929451,"user":{"login":"jastkand","id":1298360,"avatar_url":"https://avatars.githubusercontent.com/u/1298360?v=3","gravatar_id":"","url":"https://api.github.com/users/jastkand","html_url":"https://github.com/jastkand","followers_url":"https://api.github.com/users/jastkand/followers","following_url":"https://api.github.com/users/jastkand/following{/other_user}","gists_url":"https://api.github.com/users/jastkand/gists{/gist_id}","starred_url":"https://api.github.com/users/jastkand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jastkand/subscriptions","organizations_url":"https://api.github.com/users/jastkand/orgs","repos_url":"https://api.github.com/users/jastkand/repos","events_url":"https://api.github.com/users/jastkand/events{/privacy}","received_events_url":"https://api.github.com/users/jastkand/received_events","type":"User","site_admin":false},"created_at":"2016-01-05T08:00:52Z","updated_at":"2016-01-05T08:00:52Z","body":"Unfortunately this gem is used by paperclip gem, so I cannot change the behavior of the last one to use file extension. Thanks anyway for great API of mimemagic gem which allows to remove some rules which doesn't work for some tasks and to define ones that work. It's very handy."}}