Use Automatic representation for all image pickers

This commit is contained in:
Eric Bailey
2025-09-02 21:03:10 -05:00
parent bec0329774
commit dfe49c69d8
2 changed files with 7 additions and 3 deletions
+3 -1
View File
@@ -23,6 +23,8 @@ export async function openPicker(opts?: ImagePickerOptions) {
selectionLimit: 1, selectionLimit: 1,
...opts, ...opts,
legacy: true, legacy: true,
preferredAssetRepresentationMode:
UIImagePickerPreferredAssetRepresentationMode.Automatic,
}) })
return (response.assets ?? []) return (response.assets ?? [])
@@ -54,7 +56,7 @@ export async function openUnifiedPicker({
base64: isWeb, base64: isWeb,
selectionLimit: isIOS ? selectionCountRemaining : undefined, selectionLimit: isIOS ? selectionCountRemaining : undefined,
preferredAssetRepresentationMode: preferredAssetRepresentationMode:
UIImagePickerPreferredAssetRepresentationMode.Current, UIImagePickerPreferredAssetRepresentationMode.Automatic,
videoMaxDuration: VIDEO_MAX_DURATION_MS / 1000, videoMaxDuration: VIDEO_MAX_DURATION_MS / 1000,
}) })
} }
+4 -2
View File
@@ -4,7 +4,7 @@ import {Image as ExpoImage} from 'expo-image'
import { import {
type ImagePickerOptions, type ImagePickerOptions,
launchImageLibraryAsync, launchImageLibraryAsync,
MediaTypeOptions, UIImagePickerPreferredAssetRepresentationMode,
} from 'expo-image-picker' } from 'expo-image-picker'
import {msg, Trans} from '@lingui/macro' import {msg, Trans} from '@lingui/macro'
import {useLingui} from '@lingui/react' import {useLingui} from '@lingui/react'
@@ -97,10 +97,12 @@ export function StepProfile() {
const response = await sheetWrapper( const response = await sheetWrapper(
launchImageLibraryAsync({ launchImageLibraryAsync({
exif: false, exif: false,
mediaTypes: MediaTypeOptions.Images, mediaTypes: ['images'],
quality: 1, quality: 1,
...opts, ...opts,
legacy: true, legacy: true,
preferredAssetRepresentationMode:
UIImagePickerPreferredAssetRepresentationMode.Automatic,
}), }),
) )