{"action":"created","issue":{"url":"https://api.github.com/repos/mrdoob/three.js/issues/6572","labels_url":"https://api.github.com/repos/mrdoob/three.js/issues/6572/labels{/name}","comments_url":"https://api.github.com/repos/mrdoob/three.js/issues/6572/comments","events_url":"https://api.github.com/repos/mrdoob/three.js/issues/6572/events","html_url":"https://github.com/mrdoob/three.js/issues/6572","id":77613217,"number":6572,"title":"THREE.ImageLoader fails when the same url is being used twice.","user":{"login":"Fabrice3D","id":550453,"avatar_url":"https://avatars.githubusercontent.com/u/550453?v=3","gravatar_id":"","url":"https://api.github.com/users/Fabrice3D","html_url":"https://github.com/Fabrice3D","followers_url":"https://api.github.com/users/Fabrice3D/followers","following_url":"https://api.github.com/users/Fabrice3D/following{/other_user}","gists_url":"https://api.github.com/users/Fabrice3D/gists{/gist_id}","starred_url":"https://api.github.com/users/Fabrice3D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fabrice3D/subscriptions","organizations_url":"https://api.github.com/users/Fabrice3D/orgs","repos_url":"https://api.github.com/users/Fabrice3D/repos","events_url":"https://api.github.com/users/Fabrice3D/events{/privacy}","received_events_url":"https://api.github.com/users/Fabrice3D/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mrdoob/three.js/labels/Bug","name":"Bug","color":"ffcfcf"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-05-18T11:12:43Z","updated_at":"2015-05-24T14:10:31Z","closed_at":null,"body":"Just got 2 projects broken after moving from r69 to r71.\r\n\r\nthe code being used in a method that receives the material as param.\r\n\r\n```javascript\r\nvar imageLoader = new THREE.ImageLoader();\r\nvar bitmap = imageLoader.load( url, imageLoaded );\r\n \r\nfunction imageLoaded(){\r\n\t\tvar texture = material.map;\r\n\t\ttexture.image = bitmap;\r\n\t\ttexture.needsUpdate = true;\r\n}\r\n```\r\n\r\nr69 and r71 will load and update the texture with newly loaded image.\r\nIf the same url is used again, r69 works as expected, r71 crashes.\r\nThe caching mechanism seems to be the bad guy.\r\n\r\ncommenting this bit fixes my 2 projects….\r\n\r\n```javascript\r\nTHREE.ImageLoader.prototype = {\r\n\r\n\tconstructor: THREE.ImageLoader,\r\n\r\n\tload: function ( url, onLoad, onProgress, onError ) {\r\n\r\n\t\tvar scope = this;\r\n\r\n\t\t/*var cached = THREE.Cache.get( url );\r\n\r\n\t\tif ( cached !== undefined ) {\r\n\r\n\t\t\tonLoad( cached );\r\n\t\t\treturn;\r\n\r\n\t\t}*/\r\n```"},"comment":{"url":"https://api.github.com/repos/mrdoob/three.js/issues/comments/105020360","html_url":"https://github.com/mrdoob/three.js/issues/6572#issuecomment-105020360","issue_url":"https://api.github.com/repos/mrdoob/three.js/issues/6572","id":105020360,"user":{"login":"mrdoob","id":97088,"avatar_url":"https://avatars.githubusercontent.com/u/97088?v=3","gravatar_id":"","url":"https://api.github.com/users/mrdoob","html_url":"https://github.com/mrdoob","followers_url":"https://api.github.com/users/mrdoob/followers","following_url":"https://api.github.com/users/mrdoob/following{/other_user}","gists_url":"https://api.github.com/users/mrdoob/gists{/gist_id}","starred_url":"https://api.github.com/users/mrdoob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrdoob/subscriptions","organizations_url":"https://api.github.com/users/mrdoob/orgs","repos_url":"https://api.github.com/users/mrdoob/repos","events_url":"https://api.github.com/users/mrdoob/events{/privacy}","received_events_url":"https://api.github.com/users/mrdoob/received_events","type":"User","site_admin":false},"created_at":"2015-05-24T14:10:30Z","updated_at":"2015-05-24T14:10:30Z","body":"Oh! Right, because texture replaces the image... I should add a example/test for that."}}