From 6f804121ff822ef1cab93b09c5d8e192a5da8520 Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Fri, 29 Dec 2023 14:56:23 +0700 Subject: [PATCH 1/2] fix default avatar render with low quality --- src/components/Lightbox.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Lightbox.js b/src/components/Lightbox.js index 06f8ee4cfeb62..abdd9217e2bce 100644 --- a/src/components/Lightbox.js +++ b/src/components/Lightbox.js @@ -183,8 +183,8 @@ function Lightbox({isAuthTokenRequired, source, onScaleChanged, onPress, onError onError={onError} onLoadEnd={() => setImageLoaded(true)} onLoad={(e) => { - const width = (e.nativeEvent?.width || 0) / PixelRatio.get(); - const height = (e.nativeEvent?.height || 0) / PixelRatio.get(); + const width = (e.nativeEvent?.width || 0) * PixelRatio.get(); + const height = (e.nativeEvent?.height || 0) * PixelRatio.get(); setImageDimensions({...imageDimensions, lightboxSize: {width, height}}); }} /> From 0ab7aad047a755fa26e0f3696efc72602b3be17b Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Tue, 2 Jan 2024 14:34:14 +0700 Subject: [PATCH 2/2] update change --- src/components/Lightbox.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Lightbox.js b/src/components/Lightbox.js index abdd9217e2bce..45326edb46107 100644 --- a/src/components/Lightbox.js +++ b/src/components/Lightbox.js @@ -205,8 +205,8 @@ function Lightbox({isAuthTokenRequired, source, onScaleChanged, onPress, onError isAuthTokenRequired={isAuthTokenRequired} onLoadEnd={() => setFallbackLoaded(true)} onLoad={(e) => { - const width = e.nativeEvent?.width || 0; - const height = e.nativeEvent?.height || 0; + const width = (e.nativeEvent?.width || 0) * PixelRatio.get(); + const height = (e.nativeEvent?.height || 0) * PixelRatio.get(); if (imageDimensions?.lightboxSize != null) { return;