From 858d4c8c8811ca8e16bffe3bfe0d541e576177ec Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Tue, 21 Mar 2023 12:59:10 -0500 Subject: Introduce an image sizes cache to improve feed layouts (close #213) (#335) * Introduce an image sizes cache to improve feed layouts (close #213) * Clear out resolved promises from the image cache --- src/lib/media/manip.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/lib') diff --git a/src/lib/media/manip.ts b/src/lib/media/manip.ts index e44ee3907..6ff8b691c 100644 --- a/src/lib/media/manip.ts +++ b/src/lib/media/manip.ts @@ -5,6 +5,11 @@ import RNFS from 'react-native-fs' import uuid from 'react-native-uuid' import * as Toast from 'view/com/util/Toast' +export interface Dim { + width: number + height: number +} + export interface DownloadAndResizeOpts { uri: string width: number @@ -119,10 +124,6 @@ export async function compressIfNeeded( return finalImg } -export interface Dim { - width: number - height: number -} export function scaleDownDimensions(dim: Dim, max: Dim): Dim { if (dim.width < max.width && dim.height < max.height) { return dim -- cgit 1.4.1