{"action":"created","issue":{"url":"https://api.github.com/repos/aadsm/JavaScript-ID3-Reader/issues/55","labels_url":"https://api.github.com/repos/aadsm/JavaScript-ID3-Reader/issues/55/labels{/name}","comments_url":"https://api.github.com/repos/aadsm/JavaScript-ID3-Reader/issues/55/comments","events_url":"https://api.github.com/repos/aadsm/JavaScript-ID3-Reader/issues/55/events","html_url":"https://github.com/aadsm/JavaScript-ID3-Reader/issues/55","id":118273049,"number":55,"title":"loadFromLink() doesn't work","user":{"login":"RutSzymon","id":1850046,"avatar_url":"https://avatars.githubusercontent.com/u/1850046?v=3","gravatar_id":"","url":"https://api.github.com/users/RutSzymon","html_url":"https://github.com/RutSzymon","followers_url":"https://api.github.com/users/RutSzymon/followers","following_url":"https://api.github.com/users/RutSzymon/following{/other_user}","gists_url":"https://api.github.com/users/RutSzymon/gists{/gist_id}","starred_url":"https://api.github.com/users/RutSzymon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RutSzymon/subscriptions","organizations_url":"https://api.github.com/users/RutSzymon/orgs","repos_url":"https://api.github.com/users/RutSzymon/repos","events_url":"https://api.github.com/users/RutSzymon/events{/privacy}","received_events_url":"https://api.github.com/users/RutSzymon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-11-22T16:25:16Z","updated_at":"2015-11-23T20:03:35Z","closed_at":null,"body":"I followed the documentation and example: http://web.ist.utl.pt/antonio.afonso/www.aadsm.net/libraries/id3/\r\n\r\nThis is my code:\r\n```coffeescript\r\nclass Mfolio.Views.SongsEdit extends Marionette.ItemView\r\n  template: JST[\"songs/edit\"]\r\n\r\n  events:\r\n    \"change #song_image\": \"loadFromFile\"\r\n\r\n  onRender: ->\r\n    @loadFromLink()\r\n\r\n  loadFromFile: ->\r\n    file = $(\"#song_image\")[0].files[0]\r\n    url = file.urn or file.name\r\n    @loadUrl url, FileAPIReader(file)\r\n\r\n  loadFromLink: ->\r\n    url = @model.get(\"asset\").asset.url\r\n    @loadUrl url\r\n\r\n  loadUrl: (url, reader) ->\r\n    ID3.loadTags url, (->\r\n      tags = ID3.getAllTags(url)\r\n      $(\"#album\").val(tags.album or \"\")\r\n      if \"picture\" of tags\r\n        image = tags.picture\r\n        base64String = \"\"\r\n        i = 0\r\n        console.log(image.data.length)\r\n        while i < image.data.length\r\n          base64String += String.fromCharCode(image.data[i])\r\n          i++\r\n        $(\"#thumbnail\").prop(\"src\", \"data:\" + image.format + \";base64,\" + window.btoa(base64String))\r\n        $(\"#thumbnail\")[0].style.display = \"block\"\r\n      else\r\n        $(\"#thumbnail\")[0].style.display = \"none\"\r\n    ),\r\n    tags: [\r\n      \"album\"\r\n      \"picture\"\r\n    ],\r\n    dataReader: reader\r\n```\r\nThere are almost the same functions like in index.js from previously mentioned example (view-source:http://web.ist.utl.pt/antonio.afonso/www.aadsm.net/libraries/id3/index.js). The difference is my loadFromLink() is fired on render instead on link click.\r\n\r\n**Problem is**:\r\nthe loadFromFile() works perfectly, but loadFromLink() shows only broken image icon. Asset url is ok, because album tag shows up correctly, only image doesn't load.\r\n\r\nI noticed the content of base64String of mp3 from file is different than of this one from link (even if I choose the same uploaded file to which the link leads) but I have no idea why."},"comment":{"url":"https://api.github.com/repos/aadsm/JavaScript-ID3-Reader/issues/comments/159047705","html_url":"https://github.com/aadsm/JavaScript-ID3-Reader/issues/55#issuecomment-159047705","issue_url":"https://api.github.com/repos/aadsm/JavaScript-ID3-Reader/issues/55","id":159047705,"user":{"login":"RutSzymon","id":1850046,"avatar_url":"https://avatars.githubusercontent.com/u/1850046?v=3","gravatar_id":"","url":"https://api.github.com/users/RutSzymon","html_url":"https://github.com/RutSzymon","followers_url":"https://api.github.com/users/RutSzymon/followers","following_url":"https://api.github.com/users/RutSzymon/following{/other_user}","gists_url":"https://api.github.com/users/RutSzymon/gists{/gist_id}","starred_url":"https://api.github.com/users/RutSzymon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RutSzymon/subscriptions","organizations_url":"https://api.github.com/users/RutSzymon/orgs","repos_url":"https://api.github.com/users/RutSzymon/repos","events_url":"https://api.github.com/users/RutSzymon/events{/privacy}","received_events_url":"https://api.github.com/users/RutSzymon/received_events","type":"User","site_admin":false},"created_at":"2015-11-23T20:03:35Z","updated_at":"2015-11-23T20:03:35Z","body":"For example this: http://www52.zippyshare.com/v/XXmPRX8t/file.html\r\nbut for now it happened to any file I tried :)\r\n"}}