APP-2971: Fix onboarding avatar compression after Expo 57 (#11580)

This commit is contained in:
Samuel Newman
2026-08-27 19:14:18 +03:00
committed by GitHub
parent 41f2d203c3
commit 9d76e42606
3 changed files with 16 additions and 2 deletions
+9
View File
@@ -0,0 +1,9 @@
import {getInfoAsync} from 'expo-file-system/legacy'
export async function getUriSize(uri: string): Promise<number> {
const info = await getInfoAsync(uri)
if (!info.exists) {
throw new Error('Failed to read image size')
}
return info.size
}
+5
View File
@@ -0,0 +1,5 @@
export async function getUriSize(uri: string): Promise<number> {
const response = await fetch(uri)
const blob = await response.blob()
return blob.size
}