From d35ca783e7b2aec17a1b92adc0bd63e2030f49e1 Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Thu, 21 Oct 2021 11:09:32 +0200 Subject: [PATCH] fix(ui): fix image attachment resizing --- .../lib/src/attachment/image_attachment.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/stream_chat_flutter/lib/src/attachment/image_attachment.dart b/packages/stream_chat_flutter/lib/src/attachment/image_attachment.dart index 16b5f4b7..67c7dd2b 100644 --- a/packages/stream_chat_flutter/lib/src/attachment/image_attachment.dart +++ b/packages/stream_chat_flutter/lib/src/attachment/image_attachment.dart @@ -72,7 +72,11 @@ class ImageAttachment extends AttachmentWidget { } var imageUri = Uri.parse(imageUrl); - if (imageUri.host.endsWith('stream-io-cdn.com')) { + if (imageUri.host.endsWith('stream-io-cdn.com') && + imageUri.queryParameters['h'] == '*' && + imageUri.queryParameters['w'] == '*' && + imageUri.queryParameters['crop'] == '*' && + imageUri.queryParameters['resize'] == '*') { imageUri = imageUri.replace(queryParameters: { ...imageUri.queryParameters, 'h': '400',