{"action":"created","issue":{"url":"https://api.github.com/repos/chrisben/imgcache.js/issues/98","labels_url":"https://api.github.com/repos/chrisben/imgcache.js/issues/98/labels{/name}","comments_url":"https://api.github.com/repos/chrisben/imgcache.js/issues/98/comments","events_url":"https://api.github.com/repos/chrisben/imgcache.js/issues/98/events","html_url":"https://github.com/chrisben/imgcache.js/issues/98","id":56032052,"number":98,"title":"ImgCache does not load cached image","user":{"login":"JcDenton86","id":1433320,"avatar_url":"https://avatars.githubusercontent.com/u/1433320?v=3","gravatar_id":"","url":"https://api.github.com/users/JcDenton86","html_url":"https://github.com/JcDenton86","followers_url":"https://api.github.com/users/JcDenton86/followers","following_url":"https://api.github.com/users/JcDenton86/following{/other_user}","gists_url":"https://api.github.com/users/JcDenton86/gists{/gist_id}","starred_url":"https://api.github.com/users/JcDenton86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JcDenton86/subscriptions","organizations_url":"https://api.github.com/users/JcDenton86/orgs","repos_url":"https://api.github.com/users/JcDenton86/repos","events_url":"https://api.github.com/users/JcDenton86/events{/privacy}","received_events_url":"https://api.github.com/users/JcDenton86/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-30T13:16:41Z","updated_at":"2015-02-05T09:21:08Z","closed_at":null,"body":"Hi, I am caching images fetched with $http like this: \r\n```\r\nvar atsize = respdata.data.posts[i].attachments.length;\r\n    var images=[];\r\n    for(j=0;j<atsize;j++){\r\n        images.push(respdata.data.posts[i].attachments[j].url);\r\n        ImgCache.cacheFile(respdata.data.posts[i].attachments[j].url);\r\n    }\r\n```\r\nOf course I have initialized the ImgCache. So, the 1st time the app runs i am downloading and caching the images ( i checked using file explorer that the images are downloaded). I have also created a small angularjs directive like the one bellow: \r\n```\r\n(function(angular) {\r\n    \"use strict\";\r\n    var ngImgCache = angular.module('ngImgCache', []);\r\n\r\n    ngImgCache.directive('ngCache', function() {\r\n        return {\r\n            restrict: 'A',\r\n            link: function(scope, el, attrs) {\t\r\n                attrs.$observe('ngSrc', function(src) {\r\n\t\t\tImgCache.useCachedFile(el);\r\n                });\r\n\t\tattrs.$observe('icBg', function(src) {\r\n\t\t\tImgCache.getCachedFileURL(src, function(src, dest) {\r\n\t\t\tel.css({'background-image': 'url(' + dest + ')' });\r\n                       });\r\n                 });\r\n            }\r\n        };\r\n    });\r\n})(angular);\r\n```\r\nSo in my html i can use `<img ng-cache ng-src={{srcURL}} />`\r\n\r\nRunning the application while online i am seeing the logs and the images are downloaded and cached and the cached version is used. Running the application offline i get the error:\r\n\r\n01-30 15:10:44.476: E/AndroidProtocolHandler(29088): Unable to open asset URL: file:///android_asset/www/[%22http:////example.com//entries//images//uploads//2014//11//DSC_31.jpg%22\r\n\r\nWhile the ImgCache should use the cached version of the ng-src value as applied from the directive, it is not. What' s wrong with the implementation? Is that an issue of ImgCache or am I doing something wrong?\r\n\r\nMy setup is: Cordova 3.6.4, Angular 1.3 and Onsen UI 1.2.1\r\n\r\nThank you in advance\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/chrisben/imgcache.js/issues/comments/73016541","html_url":"https://github.com/chrisben/imgcache.js/issues/98#issuecomment-73016541","issue_url":"https://api.github.com/repos/chrisben/imgcache.js/issues/98","id":73016541,"user":{"login":"JcDenton86","id":1433320,"avatar_url":"https://avatars.githubusercontent.com/u/1433320?v=3","gravatar_id":"","url":"https://api.github.com/users/JcDenton86","html_url":"https://github.com/JcDenton86","followers_url":"https://api.github.com/users/JcDenton86/followers","following_url":"https://api.github.com/users/JcDenton86/following{/other_user}","gists_url":"https://api.github.com/users/JcDenton86/gists{/gist_id}","starred_url":"https://api.github.com/users/JcDenton86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JcDenton86/subscriptions","organizations_url":"https://api.github.com/users/JcDenton86/orgs","repos_url":"https://api.github.com/users/JcDenton86/repos","events_url":"https://api.github.com/users/JcDenton86/events{/privacy}","received_events_url":"https://api.github.com/users/JcDenton86/received_events","type":"User","site_admin":false},"created_at":"2015-02-05T09:21:08Z","updated_at":"2015-02-05T09:21:08Z","body":"Hi, any news on that? an answer or advice would be really helpful"}}