From f9af09c0d232e4796d118423ba1d3c71d2d4478b Mon Sep 17 00:00:00 2001 From: Rohit Bansal <40559587+Rohit3523@users.noreply.github.com> Date: Tue, 27 Jan 2026 01:39:33 +0530 Subject: [PATCH 1/8] Pass max height and width in load async --- app/containers/message/Components/Attachments/Image/Image.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/containers/message/Components/Attachments/Image/Image.tsx b/app/containers/message/Components/Attachments/Image/Image.tsx index 74d43d0e84f..ff63da3b655 100644 --- a/app/containers/message/Components/Attachments/Image/Image.tsx +++ b/app/containers/message/Components/Attachments/Image/Image.tsx @@ -28,7 +28,9 @@ export const MessageImage = React.memo(({ uri, status, encrypted = false, imageP Image.loadAsync(uri, { onError: e => { log(e); - } + }, + maxHeight: 1000, + maxWidth: 1000 }).then(image => { setImageDimensions({ width: image.width, height: image.height }); }); From d7b87a4a40612d3c66cd62852dd94c82c68c32e4 Mon Sep 17 00:00:00 2001 From: Rohit <40559587+Rohit3523@users.noreply.github.com> Date: Tue, 10 Feb 2026 18:52:05 +0530 Subject: [PATCH 2/8] reduce max image dimensions --- app/containers/message/Components/Attachments/Image/Image.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/containers/message/Components/Attachments/Image/Image.tsx b/app/containers/message/Components/Attachments/Image/Image.tsx index ff63da3b655..679694ffd1c 100644 --- a/app/containers/message/Components/Attachments/Image/Image.tsx +++ b/app/containers/message/Components/Attachments/Image/Image.tsx @@ -29,8 +29,8 @@ export const MessageImage = React.memo(({ uri, status, encrypted = false, imageP onError: e => { log(e); }, - maxHeight: 1000, - maxWidth: 1000 + maxHeight: 100, + maxWidth: 100 }).then(image => { setImageDimensions({ width: image.width, height: image.height }); }); From 3018942da0e2a96dd23d8c7c6175a6146cbd7a6e Mon Sep 17 00:00:00 2001 From: Rohit <40559587+Rohit3523@users.noreply.github.com> Date: Tue, 10 Feb 2026 18:54:49 +0530 Subject: [PATCH 3/8] add error handling --- app/containers/message/Components/Attachments/Image/Image.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/containers/message/Components/Attachments/Image/Image.tsx b/app/containers/message/Components/Attachments/Image/Image.tsx index 679694ffd1c..7cd46de22e4 100644 --- a/app/containers/message/Components/Attachments/Image/Image.tsx +++ b/app/containers/message/Components/Attachments/Image/Image.tsx @@ -33,6 +33,8 @@ export const MessageImage = React.memo(({ uri, status, encrypted = false, imageP maxWidth: 100 }).then(image => { setImageDimensions({ width: image.width, height: image.height }); + }).catch(e => { + log(e); }); } }, [uri, status]); From 312324f94dad9a2535bc2e9ef27ad163b43ef357 Mon Sep 17 00:00:00 2001 From: Rohit3523 Date: Tue, 10 Feb 2026 13:28:32 +0000 Subject: [PATCH 4/8] chore: format code and fix lint issues --- .../message/Components/Attachments/Image/Image.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/containers/message/Components/Attachments/Image/Image.tsx b/app/containers/message/Components/Attachments/Image/Image.tsx index 7cd46de22e4..140314fae9e 100644 --- a/app/containers/message/Components/Attachments/Image/Image.tsx +++ b/app/containers/message/Components/Attachments/Image/Image.tsx @@ -31,11 +31,13 @@ export const MessageImage = React.memo(({ uri, status, encrypted = false, imageP }, maxHeight: 100, maxWidth: 100 - }).then(image => { - setImageDimensions({ width: image.width, height: image.height }); - }).catch(e => { - log(e); - }); + }) + .then(image => { + setImageDimensions({ width: image.width, height: image.height }); + }) + .catch(e => { + log(e); + }); } }, [uri, status]); From 90bbd8a783e5d45ba8516c4ee1d53e1f7fa7d31d Mon Sep 17 00:00:00 2001 From: Rohit <40559587+Rohit3523@users.noreply.github.com> Date: Tue, 10 Feb 2026 19:07:21 +0530 Subject: [PATCH 5/8] change to 1000 --- app/containers/message/Components/Attachments/Image/Image.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/containers/message/Components/Attachments/Image/Image.tsx b/app/containers/message/Components/Attachments/Image/Image.tsx index 7cd46de22e4..31af85edcad 100644 --- a/app/containers/message/Components/Attachments/Image/Image.tsx +++ b/app/containers/message/Components/Attachments/Image/Image.tsx @@ -29,8 +29,8 @@ export const MessageImage = React.memo(({ uri, status, encrypted = false, imageP onError: e => { log(e); }, - maxHeight: 100, - maxWidth: 100 + maxHeight: 1000, + maxWidth: 1000 }).then(image => { setImageDimensions({ width: image.width, height: image.height }); }).catch(e => { From c4bfc6d168dd77820067003750d91fb63a8d5afe Mon Sep 17 00:00:00 2001 From: Rohit <40559587+Rohit3523@users.noreply.github.com> Date: Tue, 10 Feb 2026 19:11:07 +0530 Subject: [PATCH 6/8] again change to 1000 --- app/containers/message/Components/Attachments/Image/Image.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/containers/message/Components/Attachments/Image/Image.tsx b/app/containers/message/Components/Attachments/Image/Image.tsx index 140314fae9e..f242298669e 100644 --- a/app/containers/message/Components/Attachments/Image/Image.tsx +++ b/app/containers/message/Components/Attachments/Image/Image.tsx @@ -29,8 +29,8 @@ export const MessageImage = React.memo(({ uri, status, encrypted = false, imageP onError: e => { log(e); }, - maxHeight: 100, - maxWidth: 100 + maxHeight: 1000, + maxWidth: 1000 }) .then(image => { setImageDimensions({ width: image.width, height: image.height }); From a2da9d15b1be0d9eb60c01e017661cedd1964b4d Mon Sep 17 00:00:00 2001 From: Rohit <40559587+Rohit3523@users.noreply.github.com> Date: Wed, 11 Feb 2026 23:08:12 +0530 Subject: [PATCH 7/8] remove error logging from image dimension loading --- app/containers/message/Components/Attachments/Image/Image.tsx | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/containers/message/Components/Attachments/Image/Image.tsx b/app/containers/message/Components/Attachments/Image/Image.tsx index f242298669e..c5f1fe973c4 100644 --- a/app/containers/message/Components/Attachments/Image/Image.tsx +++ b/app/containers/message/Components/Attachments/Image/Image.tsx @@ -35,9 +35,6 @@ export const MessageImage = React.memo(({ uri, status, encrypted = false, imageP .then(image => { setImageDimensions({ width: image.width, height: image.height }); }) - .catch(e => { - log(e); - }); } }, [uri, status]); From 480b31c84fb1f9e03b1a8fab2827456b53180c8a Mon Sep 17 00:00:00 2001 From: Rohit <40559587+Rohit3523@users.noreply.github.com> Date: Wed, 11 Feb 2026 23:11:02 +0530 Subject: [PATCH 8/8] prettier --- .../message/Components/Attachments/Image/Image.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/containers/message/Components/Attachments/Image/Image.tsx b/app/containers/message/Components/Attachments/Image/Image.tsx index c5f1fe973c4..ff63da3b655 100644 --- a/app/containers/message/Components/Attachments/Image/Image.tsx +++ b/app/containers/message/Components/Attachments/Image/Image.tsx @@ -31,10 +31,9 @@ export const MessageImage = React.memo(({ uri, status, encrypted = false, imageP }, maxHeight: 1000, maxWidth: 1000 - }) - .then(image => { - setImageDimensions({ width: image.width, height: image.height }); - }) + }).then(image => { + setImageDimensions({ width: image.width, height: image.height }); + }); } }, [uri, status]);