From 7f21d8293f3a7d88a80de43a261c1f7b3247d62b Mon Sep 17 00:00:00 2001 From: "pengfei.zhou" Date: Wed, 8 Dec 2021 17:12:08 +0800 Subject: [PATCH] android: decode base64 image synchronously --- .../doric/src/main/java/pub/doric/shader/ImageNode.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/doric-android/doric/src/main/java/pub/doric/shader/ImageNode.java b/doric-android/doric/src/main/java/pub/doric/shader/ImageNode.java index d4c9a84e..2d97108c 100644 --- a/doric-android/doric/src/main/java/pub/doric/shader/ImageNode.java +++ b/doric-android/doric/src/main/java/pub/doric/shader/ImageNode.java @@ -456,7 +456,11 @@ public class ImageNode extends ViewNode { if (!TextUtils.isEmpty(imageType) && !TextUtils.isEmpty(base64)) { try { byte[] data = Base64.decode(base64, Base64.DEFAULT); - loadIntoTarget(Glide.with(getContext()).load(data)); + Bitmap bitmap = BitmapFactory.decodeByteArray(data, 0, data.length); + view.setImageBitmap(bitmap); + if (!TextUtils.isEmpty(loadCallbackId)) { + callJSResponse(loadCallbackId); + } } catch (Exception e) { e.printStackTrace(); }