{"action":"created","issue":{"url":"https://api.github.com/repos/NativeScript/NativeScript/issues/3169","repository_url":"https://api.github.com/repos/NativeScript/NativeScript","labels_url":"https://api.github.com/repos/NativeScript/NativeScript/issues/3169/labels{/name}","comments_url":"https://api.github.com/repos/NativeScript/NativeScript/issues/3169/comments","events_url":"https://api.github.com/repos/NativeScript/NativeScript/issues/3169/events","html_url":"https://github.com/NativeScript/NativeScript/issues/3169","id":191610846,"number":3169,"title":"Android - New Image code in 2.4.0 crashes","user":{"login":"NathanaelA","id":850871,"avatar_url":"https://avatars.githubusercontent.com/u/850871?v=3","gravatar_id":"","url":"https://api.github.com/users/NathanaelA","html_url":"https://github.com/NathanaelA","followers_url":"https://api.github.com/users/NathanaelA/followers","following_url":"https://api.github.com/users/NathanaelA/following{/other_user}","gists_url":"https://api.github.com/users/NathanaelA/gists{/gist_id}","starred_url":"https://api.github.com/users/NathanaelA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NathanaelA/subscriptions","organizations_url":"https://api.github.com/users/NathanaelA/orgs","repos_url":"https://api.github.com/users/NathanaelA/repos","events_url":"https://api.github.com/users/NathanaelA/events{/privacy}","received_events_url":"https://api.github.com/users/NathanaelA/received_events","type":"User","site_admin":false},"labels":[{"id":203690377,"url":"https://api.github.com/repos/NativeScript/NativeScript/labels/Android","name":"Android","color":"c7def8","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-25T01:43:19Z","updated_at":"2016-11-25T14:01:07Z","closed_at":null,"body":"## Please, provide the details below:\r\nNew Image all cool Cache code based on bitmapfun is buggy, and will cause the app to crash after a number of images have loaded.\r\n\r\n### Did you verify this is a real problem by searching \r\nThis might be related to #3153 - however, they are reporting \"Out of memory\", if they aren't paying attention it might appear it is out of memory, when the underlying cause is actually different.\r\n\r\n### Tell us about the problem\r\nWhile it is loading url's and caching the images locally the code will crash with the following error:\r\n> An uncaught Exception occurred on \"AsyncTask #2\" thread.\r\n> java.lang.RuntimeException: An error occured while executing doInBackground()\r\n> \tat org.nativescript.widgets.image.AsyncTask$3.done(AsyncTask.java:326)\r\n> \tat java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)\r\n> \tat java.util.concurrent.FutureTask.setException(FutureTask.java:222)\r\n> \tat java.util.concurrent.FutureTask.run(FutureTask.java:242)\r\n> \tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)\r\n> \tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)\r\n> \tat java.lang.Thread.run(Thread.java:841)\r\n> Caused by: java.lang.IllegalArgumentException: Problem decoding into existing bitmap\r\n> \tat android.graphics.BitmapFactory.decodeFileDescriptor(BitmapFactory.java:670)\r\n> \tat org.nativescript.widgets.image.Resizer.decodeSampledBitmapFromDescriptor(Resizer.java:150)\r\n> \tat org.nativescript.widgets.image.Fetcher.processHttp(Fetcher.java:214)\r\n> \tat org.nativescript.widgets.image.Fetcher.processBitmap(Fetcher.java\r\n\r\nThe key error is actually this one `Caused by: java.lang.IllegalArgumentException: Problem decoding into existing bitmap`\r\n\r\nDoing some googling turns up these two stack overflows:\r\nhttp://stackoverflow.com/questions/17293117/android-bitmpafun-crashes-at-bitmapfactory-decodefiledescriptor\r\nhttp://stackoverflow.com/questions/16034756/why-does-decoding-bitmap-with-inbitmap-always-get-java-lang-illegalargumentexcep\r\n\r\nNeither one point to a concrete solution, but they both show that this issue is common using the default bitmap fun code base.\r\n\r\n### Which platform(s) does your issue occur on?\r\nAndroid 6.0  (might be others)\r\n\r\n### Please provide the following version numbers that your issue occurs with:\r\n2.4.0\r\n\r\n### Please tell us how to recreate the issue in as much detail as possible.\r\nLoad lots of images from a remote site.  I'm using a RLV that displays about 16 images on the screen at one time (each one is < 200x200 bytes) and the cache shows the majority of the images are around 8k in file size.   The page I can scroll has over 8000 images that can be downloaded and viewed; so you can scroll and scroll.   \r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/NativeScript/NativeScript/issues/comments/262962379","html_url":"https://github.com/NativeScript/NativeScript/issues/3169#issuecomment-262962379","issue_url":"https://api.github.com/repos/NativeScript/NativeScript/issues/3169","id":262962379,"user":{"login":"NathanaelA","id":850871,"avatar_url":"https://avatars.githubusercontent.com/u/850871?v=3","gravatar_id":"","url":"https://api.github.com/users/NathanaelA","html_url":"https://github.com/NathanaelA","followers_url":"https://api.github.com/users/NathanaelA/followers","following_url":"https://api.github.com/users/NathanaelA/following{/other_user}","gists_url":"https://api.github.com/users/NathanaelA/gists{/gist_id}","starred_url":"https://api.github.com/users/NathanaelA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NathanaelA/subscriptions","organizations_url":"https://api.github.com/users/NathanaelA/orgs","repos_url":"https://api.github.com/users/NathanaelA/repos","events_url":"https://api.github.com/users/NathanaelA/events{/privacy}","received_events_url":"https://api.github.com/users/NathanaelA/received_events","type":"User","site_admin":false},"created_at":"2016-11-25T14:01:07Z","updated_at":"2016-11-25T14:01:07Z","body":"Please note, I wasn't getting any **out of memory** errors; I do believe the caching is working fine for that part.   ;-)          I was making a suggestion that perhaps others are mis-attributing this issue to OOM errors, since in the past the crashes we in this area we saw are due to a OOM.  \r\n\r\nI'll run some tests with your code; but the issue I'm pretty sure is NOT a bad image; the issue is that the images are all different sizes and I suspect the image calculation size code is broken in the new image system.\r\n\r\n"}}
{"actor":{"display_login":"NathanaelA"}}