{"action":"created","issue":{"url":"https://api.github.com/repos/bumptech/glide/issues/3507","repository_url":"https://api.github.com/repos/bumptech/glide","labels_url":"https://api.github.com/repos/bumptech/glide/issues/3507/labels{/name}","comments_url":"https://api.github.com/repos/bumptech/glide/issues/3507/comments","events_url":"https://api.github.com/repos/bumptech/glide/issues/3507/events","html_url":"https://github.com/bumptech/glide/issues/3507","id":404573613,"node_id":"MDU6SXNzdWU0MDQ1NzM2MTM=","number":3507,"title":"Glide v3.8.0 load image sometimes mistakes occur.","user":{"login":"hansionit","id":22082059,"node_id":"MDQ6VXNlcjIyMDgyMDU5","avatar_url":"https://avatars1.githubusercontent.com/u/22082059?v=4","gravatar_id":"","url":"https://api.github.com/users/hansionit","html_url":"https://github.com/hansionit","followers_url":"https://api.github.com/users/hansionit/followers","following_url":"https://api.github.com/users/hansionit/following{/other_user}","gists_url":"https://api.github.com/users/hansionit/gists{/gist_id}","starred_url":"https://api.github.com/users/hansionit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hansionit/subscriptions","organizations_url":"https://api.github.com/users/hansionit/orgs","repos_url":"https://api.github.com/users/hansionit/repos","events_url":"https://api.github.com/users/hansionit/events{/privacy}","received_events_url":"https://api.github.com/users/hansionit/received_events","type":"User","site_admin":false},"labels":[{"id":739139624,"node_id":"MDU6TGFiZWw3MzkxMzk2MjQ=","url":"https://api.github.com/repos/bumptech/glide/labels/stale","name":"stale","color":"e28966","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2019-01-30T02:28:24Z","updated_at":"2019-02-11T02:18:33Z","closed_at":null,"author_association":"NONE","body":"\r\n**Glide Version**:3.8.0\r\n\r\n**Integration libraries**:okhttp:3.9.0\r\n\r\n**Device/Android Version**:Google Pixel Android 9   / ZUK Z2 Android 7.0\r\n\r\n**Glide load line / `GlideModule` (if any) / list Adapter code (if any)**:\r\n```java\r\npublic class GlideConfiguration extends OkHttpGlideModule {\r\n \r\n    ...\r\n\r\n    @Override\r\n    public void applyOptions(final Context context, GlideBuilder builder) {\r\n\r\n        builder.setDiskCache(new DiskCache.Factory() {\r\n            @Override\r\n            public DiskCache build() {\r\n                return getDiskCache(context);\r\n            }\r\n        });\r\n\r\n        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\r\n            builder.setDecodeFormat(DecodeFormat.PREFER_ARGB_8888);\r\n        }\r\n    }\r\n\r\n    ....\r\n}\r\n\r\n\r\n\r\n Glide\r\n                .with(context)\r\n                .load(imageUrl)\r\n                .asBitmap()\r\n                .crossFade()\r\n                .listener(new RequestListener<String, Bitmap>() {\r\n                    @Override\r\n                    public boolean onException(Exception e, String model, Target<Bitmap> target, boolean isFirstResource) {\r\n                        LogHandler.d(\"onException\",e.getMessage() + \",\"+imageUrl);\r\n                        return false;\r\n                    }\r\n\r\n                    @Override\r\n                    public boolean onResourceReady(Bitmap resource, String model, Target<Bitmap> target, boolean isFromMemoryCache, boolean isFirstResource) {\r\n                        return false;\r\n                    }\r\n                })\r\n                .format(DecodeFormat.PREFER_RGB_565)\r\n                .into(imageView);\r\n```\r\n\r\n**Layout XML**:\r\n```xml\r\n <ImageView\r\n            android:id=\"@+id/thumb\"\r\n            android:layout_width=\"match_parent\"\r\n            android:layout_height=\"200dp\"\r\n            android:scaleType=\"fitXY\" />\r\n```\r\n\r\n\r\n**Stack trace / LogCat**:\r\n```ruby\r\n\r\n    03-01 10:16:50.116 18365-19214/com.hansion.app W/BitmapFactory: bitmap marked for reuse (545664bytes) can't fit new bitmap (1091328 bytes)\r\n            03-01 10:16:50.124 18365-18365/com.hansion.app W/System.err: java.lang.IllegalArgumentException: Problem decoding into existing bitmap\r\n    03-01 10:16:50.124 18365-18365/com.hansion.app W/System.err:     at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:735)\r\n            03-01 10:16:50.124 18365-18365/com.hansion.app W/System.err:     at com.networkbench.agent.impl.instrumentation.NBSBitmapFactoryInstrumentation.decodeStream(SourceFile:88)\r\n            03-01 10:16:50.124 18365-18365/com.hansion.app W/System.err:     at com.bumptech.glide.load.resource.bitmap.Downsampler.decodeStream(Downsampler.java:329)\r\n            03-01 10:16:50.124 18365-18365/com.hansion.app W/System.err:     at com.bumptech.glide.load.resource.bitmap.Downsampler.downsampleWithSize(Downsampler.java:220)\r\n            03-01 10:16:50.124 18365-18365/com.hansion.app W/System.err:     at com.bumptech.glide.load.resource.bitmap.Downsampler.decode(Downsampler.java:153)\r\n            03-01 10:16:50.124 18365-18365/com.hansion.app W/System.err:     at com.bumptech.glide.load.resource.bitmap.StreamBitmapDecoder.decode(StreamBitmapDecoder.java:50)\r\n            03-01 10:16:50.124 18365-18365/com.hansion.app W/System.err:     at com.bumptech.glide.load.resource.bitmap.StreamBitmapDecoder.decode(StreamBitmapDecoder.java:19)\r\n            03-01 10:16:50.124 18365-18365/com.hansion.app W/System.err:     at com.bumptech.glide.load.resource.bitmap.ImageVideoBitmapDecoder.decode(ImageVideoBitmapDecoder.java:39)\r\n            03-01 10:16:50.124 18365-18365/com.hansion.app W/System.err:     at com.bumptech.glide.load.resource.bitmap.ImageVideoBitmapDecoder.decode(ImageVideoBitmapDecoder.java:20)\r\n            03-01 10:16:50.124 18365-18365/com.hansion.app W/System.err:     at com.bumptech.glide.load.engine.DecodeJob.decodeFromSourceData(DecodeJob.java:190)\r\n            03-01 10:16:50.124 18365-18365/com.hansion.app W/System.err:     at com.bumptech.glide.load.engine.DecodeJob.decodeSource(DecodeJob.java:177)\r\n            03-01 10:16:50.125 18365-18365/com.hansion.app W/System.err:     at com.bumptech.glide.load.engine.DecodeJob.decodeFromSource(DecodeJob.java:128)\r\n            03-01 10:16:50.125 18365-18365/com.hansion.app W/System.err:     at com.bumptech.glide.load.engine.EngineRunnable.decodeFromSource(EngineRunnable.java:127)\r\n            03-01 10:16:50.125 18365-18365/com.hansion.app W/System.err:     at com.bumptech.glide.load.engine.EngineRunnable.decode(EngineRunnable.java:106)\r\n            03-01 10:16:50.125 18365-18365/com.hansion.app W/System.err:     at com.bumptech.glide.load.engine.EngineRunnable.run(EngineRunnable.java:58)\r\n            03-01 10:16:50.125 18365-18365/com.hansion.app W/System.err:     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:458)\r\n            03-01 10:16:50.125 18365-18365/com.hansion.app W/System.err:     at java.util.concurrent.FutureTask.run(FutureTask.java:266)\r\n            03-01 10:16:50.125 18365-18365/com.hansion.app W/System.err:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)\r\n            03-01 10:16:50.125 18365-18365/com.hansion.app W/System.err:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)\r\n            03-01 10:16:50.125 18365-18365/com.hansion.app W/System.err:     at java.lang.Thread.run(Thread.java:764)\r\n            03-01 10:16:50.125 18365-18365/com.hansion.app W/System.err:     at com.bumptech.glide.load.engine.executor.FifoPriorityThreadPoolExecutor$DefaultThreadFactory$1.run(FifoPriorityThreadPoolExecutor.java:118)\r\n\r\n```\r\n\r\nI set default DecodeFormat is PREFER_ARGB_8888.\r\n\r\nbut When I load with  .format(DecodeFormat.PREFER_RGB_565) ,sometimes mistakes occur.\r\n\r\nurl:https://d.ifengimg.com/w696_h392_q100_webp/p0.ifengimg.com/pmop/2018/0124/E13D8ED46B6E4C4DA8FC6F6C2748B9B486279A4F_size330_w658_h370.png.webp\r\n\r\nwidth:696,height:392\r\n\r\n\"bitmap marked for reuse (545664bytes) can't fit new bitmap (1091328 bytes)\",I think sometimes this setting is invalid.Sometimes it still uses PREFER_ARGB_8888 to load.\r\n\r\nwhen I load with .format(DecodeFormat.PREFER_ARGB_8888) ,Errors will not happen again.But Sometimes I need to use .format(DecodeFormat.PREFER_RGB_565) to load image.\r\nPlease help me solve this problem.Thanks!\r\n\r\nI loading image on RecyclerView,Sometimes mistakes occur when sliding upwards.\r\n"},"comment":{"url":"https://api.github.com/repos/bumptech/glide/issues/comments/462204794","html_url":"https://github.com/bumptech/glide/issues/3507#issuecomment-462204794","issue_url":"https://api.github.com/repos/bumptech/glide/issues/3507","id":462204794,"node_id":"MDEyOklzc3VlQ29tbWVudDQ2MjIwNDc5NA==","user":{"login":"hansionit","id":22082059,"node_id":"MDQ6VXNlcjIyMDgyMDU5","avatar_url":"https://avatars1.githubusercontent.com/u/22082059?v=4","gravatar_id":"","url":"https://api.github.com/users/hansionit","html_url":"https://github.com/hansionit","followers_url":"https://api.github.com/users/hansionit/followers","following_url":"https://api.github.com/users/hansionit/following{/other_user}","gists_url":"https://api.github.com/users/hansionit/gists{/gist_id}","starred_url":"https://api.github.com/users/hansionit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hansionit/subscriptions","organizations_url":"https://api.github.com/users/hansionit/orgs","repos_url":"https://api.github.com/users/hansionit/repos","events_url":"https://api.github.com/users/hansionit/events{/privacy}","received_events_url":"https://api.github.com/users/hansionit/received_events","type":"User","site_admin":false},"created_at":"2019-02-11T02:18:33Z","updated_at":"2019-02-11T02:18:33Z","author_association":"NONE","body":"Could you help me?"}}
{"actor":{"display_login":"hansionit"}}