APP-2971: Fix onboarding avatar compression after Expo 57 (#11580)
This commit is contained in:
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user