From d7f40b7e7fdbc076ef7f6fbc63bd2f87525ca422 Mon Sep 17 00:00:00 2001 From: Spence Pope Date: Wed, 15 Jul 2026 07:36:04 -0400 Subject: [PATCH] fix android carousel jiggle from cdn-rounded aspect ratio (#11153) --- src/components/images/Gallery/index.tsx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/components/images/Gallery/index.tsx b/src/components/images/Gallery/index.tsx index 12067c2250..c87957503f 100644 --- a/src/components/images/Gallery/index.tsx +++ b/src/components/images/Gallery/index.tsx @@ -485,9 +485,17 @@ function GalleryImage({ loading={index === 0 ? 'eager' : 'lazy'} style={[dims]} onLoad={e => { - const ar = getAspectRatio(e.source) - if (ar && ar !== aspectRatio) { - setAspectRatio(ar) + /* + * Only sync from the loaded thumb if we don't already have a + * ratio from the record. The CDN scales thumbs to integer pixel + * dims, so its reported ratio drifts a fraction from the + * record's - re-syncing would jiggle the FlatList item widths. + */ + if (aspectRatio === undefined) { + const ar = getAspectRatio(e.source) + if (ar !== undefined) { + setAspectRatio(ar) + } } onThumbDims(index, { width: e.source.width,