mirror of https://git.lenooby09.tech/LeNooby09/social-app.git
at responsive-updates 23 lines 539 B view raw
1import { 2 ImagePickerOptions, 3 launchImageLibraryAsync, 4 MediaTypeOptions, 5} from 'expo-image-picker' 6import {getDataUriSize} from './util' 7 8export async function openPicker(opts?: ImagePickerOptions) { 9 const response = await launchImageLibraryAsync({ 10 exif: false, 11 mediaTypes: MediaTypeOptions.Images, 12 quality: 1, 13 ...opts, 14 }) 15 16 return (response.assets ?? []).map(image => ({ 17 mime: 'image/jpeg', 18 height: image.height, 19 width: image.width, 20 path: image.uri, 21 size: getDataUriSize(image.uri), 22 })) 23}