expo-image-picker 16.1.1 → 16.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/android/build.gradle +2 -2
  3. package/build/ExponentImagePicker.web.d.ts +3 -12
  4. package/build/ExponentImagePicker.web.d.ts.map +1 -1
  5. package/build/ExponentImagePicker.web.js.map +1 -1
  6. package/expo-module.config.json +1 -1
  7. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/16.1.3/expo.modules.imagepicker-16.1.3.aar +0 -0
  8. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/16.1.3/expo.modules.imagepicker-16.1.3.aar.md5 +1 -0
  9. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/16.1.3/expo.modules.imagepicker-16.1.3.aar.sha1 +1 -0
  10. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/16.1.3/expo.modules.imagepicker-16.1.3.aar.sha256 +1 -0
  11. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/16.1.3/expo.modules.imagepicker-16.1.3.aar.sha512 +1 -0
  12. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/{16.1.1/expo.modules.imagepicker-16.1.1.module → 16.1.3/expo.modules.imagepicker-16.1.3.module} +17 -17
  13. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/16.1.3/expo.modules.imagepicker-16.1.3.module.md5 +1 -0
  14. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/16.1.3/expo.modules.imagepicker-16.1.3.module.sha1 +1 -0
  15. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/16.1.3/expo.modules.imagepicker-16.1.3.module.sha256 +1 -0
  16. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/16.1.3/expo.modules.imagepicker-16.1.3.module.sha512 +1 -0
  17. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/{16.1.1/expo.modules.imagepicker-16.1.1.pom → 16.1.3/expo.modules.imagepicker-16.1.3.pom} +1 -1
  18. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/16.1.3/expo.modules.imagepicker-16.1.3.pom.md5 +1 -0
  19. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/16.1.3/expo.modules.imagepicker-16.1.3.pom.sha1 +1 -0
  20. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/16.1.3/expo.modules.imagepicker-16.1.3.pom.sha256 +1 -0
  21. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/16.1.3/expo.modules.imagepicker-16.1.3.pom.sha512 +1 -0
  22. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/maven-metadata.xml +4 -4
  23. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/maven-metadata.xml.md5 +1 -1
  24. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/maven-metadata.xml.sha1 +1 -1
  25. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/maven-metadata.xml.sha256 +1 -1
  26. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/maven-metadata.xml.sha512 +1 -1
  27. package/package.json +3 -3
  28. package/src/ExponentImagePicker.web.ts +3 -2
  29. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/16.1.1/expo.modules.imagepicker-16.1.1.aar +0 -0
  30. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/16.1.1/expo.modules.imagepicker-16.1.1.aar.md5 +0 -1
  31. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/16.1.1/expo.modules.imagepicker-16.1.1.aar.sha1 +0 -1
  32. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/16.1.1/expo.modules.imagepicker-16.1.1.aar.sha256 +0 -1
  33. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/16.1.1/expo.modules.imagepicker-16.1.1.aar.sha512 +0 -1
  34. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/16.1.1/expo.modules.imagepicker-16.1.1.module.md5 +0 -1
  35. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/16.1.1/expo.modules.imagepicker-16.1.1.module.sha1 +0 -1
  36. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/16.1.1/expo.modules.imagepicker-16.1.1.module.sha256 +0 -1
  37. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/16.1.1/expo.modules.imagepicker-16.1.1.module.sha512 +0 -1
  38. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/16.1.1/expo.modules.imagepicker-16.1.1.pom.md5 +0 -1
  39. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/16.1.1/expo.modules.imagepicker-16.1.1.pom.sha1 +0 -1
  40. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/16.1.1/expo.modules.imagepicker-16.1.1.pom.sha256 +0 -1
  41. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/16.1.1/expo.modules.imagepicker-16.1.1.pom.sha512 +0 -1
  42. /package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/{16.1.1/expo.modules.imagepicker-16.1.1-sources.jar → 16.1.3/expo.modules.imagepicker-16.1.3-sources.jar} +0 -0
  43. /package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/{16.1.1/expo.modules.imagepicker-16.1.1-sources.jar.md5 → 16.1.3/expo.modules.imagepicker-16.1.3-sources.jar.md5} +0 -0
  44. /package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/{16.1.1/expo.modules.imagepicker-16.1.1-sources.jar.sha1 → 16.1.3/expo.modules.imagepicker-16.1.3-sources.jar.sha1} +0 -0
  45. /package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/{16.1.1/expo.modules.imagepicker-16.1.1-sources.jar.sha256 → 16.1.3/expo.modules.imagepicker-16.1.3-sources.jar.sha256} +0 -0
  46. /package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/{16.1.1/expo.modules.imagepicker-16.1.1-sources.jar.sha512 → 16.1.3/expo.modules.imagepicker-16.1.3-sources.jar.sha512} +0 -0
package/CHANGELOG.md CHANGED
@@ -10,6 +10,14 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 16.1.3 — 2025-04-25
14
+
15
+ _This version does not introduce any user-facing changes._
16
+
17
+ ## 16.1.2 — 2025-04-14
18
+
19
+ _This version does not introduce any user-facing changes._
20
+
13
21
  ## 16.1.1 — 2025-04-09
14
22
 
15
23
  _This version does not introduce any user-facing changes._
@@ -4,13 +4,13 @@ plugins {
4
4
  }
5
5
 
6
6
  group = 'host.exp.exponent'
7
- version = '16.1.1'
7
+ version = '16.1.3'
8
8
 
9
9
  android {
10
10
  namespace "expo.modules.imagepicker"
11
11
  defaultConfig {
12
12
  versionCode 22
13
- versionName "16.1.1"
13
+ versionName "16.1.3"
14
14
  testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
15
15
  }
16
16
  testOptions {
@@ -1,17 +1,8 @@
1
1
  import { PermissionResponse } from 'expo-modules-core';
2
- import { ImagePickerResult, MediaType, MediaTypeOptions } from './ImagePicker.types';
2
+ import { ImagePickerOptions, ImagePickerResult } from './ImagePicker.types';
3
3
  declare const _default: {
4
- launchImageLibraryAsync({ mediaTypes, allowsMultipleSelection, base64, }: {
5
- mediaTypes?: MediaType[] | undefined;
6
- allowsMultipleSelection?: boolean | undefined;
7
- base64?: boolean | undefined;
8
- }): Promise<ImagePickerResult>;
9
- launchCameraAsync({ mediaTypes, allowsMultipleSelection, base64, cameraType, }: {
10
- mediaTypes?: MediaTypeOptions | undefined;
11
- allowsMultipleSelection?: boolean | undefined;
12
- base64?: boolean | undefined;
13
- cameraType: any;
14
- }): Promise<ImagePickerResult>;
4
+ launchImageLibraryAsync({ mediaTypes, allowsMultipleSelection, base64, }: ImagePickerOptions): Promise<ImagePickerResult>;
5
+ launchCameraAsync({ mediaTypes, allowsMultipleSelection, base64, cameraType, }: ImagePickerOptions): Promise<ImagePickerResult>;
15
6
  getCameraPermissionsAsync(): Promise<PermissionResponse>;
16
7
  requestCameraPermissionsAsync(): Promise<PermissionResponse>;
17
8
  getMediaLibraryPermissionsAsync(_writeOnly: boolean): Promise<PermissionResponse>;
@@ -1 +1 @@
1
- {"version":3,"file":"ExponentImagePicker.web.d.ts","sourceRoot":"","sources":["../src/ExponentImagePicker.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAA8B,MAAM,mBAAmB,CAAC;AAEnF,OAAO,EAGL,iBAAiB,EACjB,SAAS,EACT,gBAAgB,EAEjB,MAAM,qBAAqB,CAAC;;;;;;QAcvB,OAAO,CAAC,iBAAiB,CAAC;;;;;;QAiB1B,OAAO,CAAC,iBAAiB,CAAC;;;gDA2BoB,OAAO;oDAGH,OAAO,GAAG,OAAO,CAAC,kBAAkB,CAAC;;AApD7F,wBAuDE"}
1
+ {"version":3,"file":"ExponentImagePicker.web.d.ts","sourceRoot":"","sources":["../src/ExponentImagePicker.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAA8B,MAAM,mBAAmB,CAAC;AAEnF,OAAO,EAGL,kBAAkB,EAClB,iBAAiB,EAIlB,MAAM,qBAAqB,CAAC;;8EAcxB,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAC;oFAiB/C,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAC;;;gDA2BA,OAAO;oDAGH,OAAO,GAAG,OAAO,CAAC,kBAAkB,CAAC;;AApD7F,wBAuDE"}
@@ -1 +1 @@
1
- {"version":3,"file":"ExponentImagePicker.web.js","sourceRoot":"","sources":["../src/ExponentImagePicker.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,gBAAgB,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAEnF,OAAO,EACL,UAAU,EAIV,gBAAgB,GAEjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,MAAM,cAAc,GAA8B;IAChD,MA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CAAC,SAAS,KAAK,YAAY,CAAC,CAAC;IACxF,IAAI,kBAAkB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACpC,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,KAAK,MAAM,SAAS,IAAI,kBAAkB,EAAE,CAAC;QAC3C,mCAAmC;QACnC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC;YAChD,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC;QACzD,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import { PermissionResponse, PermissionStatus, Platform } from 'expo-modules-core';\n\nimport {\n CameraType,\n ImagePickerAsset,\n ImagePickerResult,\n MediaType,\n MediaTypeOptions,\n OpenFileBrowserOptions,\n} from './ImagePicker.types';\nimport { parseMediaTypes } from './utils';\n\nconst MediaTypeInput: Record<MediaType, string> = {\n images: 'image/*',\n videos: 'video/mp4,video/quicktime,video/x-m4v,video/*',\n livePhotos: '',\n};\n\nexport default {\n async launchImageLibraryAsync({\n mediaTypes = ['images'] as MediaType[],\n allowsMultipleSelection = false,\n base64 = false,\n }): Promise<ImagePickerResult> {\n // SSR guard\n if (!Platform.isDOMAvailable) {\n return { canceled: true, assets: null };\n }\n return await openFileBrowserAsync({\n mediaTypes,\n allowsMultipleSelection,\n base64,\n });\n },\n\n async launchCameraAsync({\n mediaTypes = MediaTypeOptions.Images,\n allowsMultipleSelection = false,\n base64 = false,\n cameraType,\n }): Promise<ImagePickerResult> {\n // SSR guard\n if (!Platform.isDOMAvailable) {\n return { canceled: true, assets: null };\n }\n return await openFileBrowserAsync({\n mediaTypes,\n allowsMultipleSelection,\n capture: cameraType ?? true,\n base64,\n });\n },\n\n /*\n * Delegate to expo-permissions to request camera permissions\n */\n async getCameraPermissionsAsync() {\n return permissionGrantedResponse();\n },\n async requestCameraPermissionsAsync() {\n return permissionGrantedResponse();\n },\n\n /*\n * Camera roll permissions don't need to be requested on web, so we always\n * respond with granted.\n */\n async getMediaLibraryPermissionsAsync(_writeOnly: boolean) {\n return permissionGrantedResponse();\n },\n async requestMediaLibraryPermissionsAsync(_writeOnly: boolean): Promise<PermissionResponse> {\n return permissionGrantedResponse();\n },\n};\n\nfunction permissionGrantedResponse(): PermissionResponse {\n return {\n status: PermissionStatus.GRANTED,\n expires: 'never',\n granted: true,\n canAskAgain: true,\n };\n}\n\nfunction openFileBrowserAsync({\n mediaTypes,\n capture = false,\n allowsMultipleSelection = false,\n base64,\n}: OpenFileBrowserOptions): Promise<ImagePickerResult> {\n const parsedMediaTypes = parseMediaTypes(mediaTypes);\n\n const mediaTypeFormat = createMediaTypeFormat(parsedMediaTypes);\n\n const input = document.createElement('input');\n input.style.display = 'none';\n input.setAttribute('type', 'file');\n input.setAttribute('accept', mediaTypeFormat);\n input.setAttribute('id', String(Math.random()));\n input.setAttribute('data-testid', 'file-input');\n if (allowsMultipleSelection) {\n input.setAttribute('multiple', 'multiple');\n }\n if (capture) {\n switch (capture) {\n case true:\n input.setAttribute('capture', 'camera');\n break;\n case CameraType.front:\n input.setAttribute('capture', 'environment');\n break;\n case CameraType.back:\n input.setAttribute('capture', 'user');\n }\n }\n document.body.appendChild(input);\n\n return new Promise((resolve) => {\n input.addEventListener('change', async () => {\n if (input.files?.length) {\n const files = allowsMultipleSelection ? input.files : [input.files[0]];\n const assets: ImagePickerAsset[] = await Promise.all(\n Array.from(files).map((file) => readFile(file, { base64 }))\n );\n\n resolve({ canceled: false, assets });\n } else {\n resolve({ canceled: true, assets: null });\n }\n document.body.removeChild(input);\n });\n input.addEventListener('cancel', () => {\n input.dispatchEvent(new Event('change'));\n });\n\n const event = new MouseEvent('click');\n input.dispatchEvent(event);\n });\n}\n\nfunction readFile(targetFile: File, options: { base64: boolean }): Promise<ImagePickerAsset> {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onerror = () => {\n reject(new Error(`Failed to read the selected media because the operation failed.`));\n };\n reader.onload = ({ target }) => {\n const uri = (target as any).result;\n const returnRaw = () => resolve({ uri, width: 0, height: 0 });\n const returnMediaData = (data: ImagePickerAsset) => {\n resolve({\n ...data,\n ...(options.base64 && { base64: uri.substr(uri.indexOf(',') + 1) }),\n file: targetFile,\n });\n };\n\n if (typeof uri === 'string') {\n if (targetFile.type.startsWith('image/')) {\n const image = new Image();\n image.src = uri;\n image.onload = () => {\n returnMediaData({\n uri,\n width: image.naturalWidth ?? image.width,\n height: image.naturalHeight ?? image.height,\n type: 'image',\n mimeType: targetFile.type,\n fileName: targetFile.name,\n fileSize: targetFile.size,\n });\n };\n image.onerror = () => returnRaw();\n } else if (targetFile.type.startsWith('video/')) {\n const video = document.createElement('video');\n video.preload = 'metadata';\n video.src = uri;\n video.onloadedmetadata = () => {\n returnMediaData({\n uri,\n width: video.videoWidth,\n height: video.videoHeight,\n type: 'video',\n mimeType: targetFile.type,\n fileName: targetFile.name,\n fileSize: targetFile.size,\n duration: video.duration,\n });\n };\n video.onerror = () => returnRaw();\n } else {\n returnRaw();\n }\n } else {\n returnRaw();\n }\n };\n\n reader.readAsDataURL(targetFile);\n });\n}\n\nfunction createMediaTypeFormat(mediaTypes: MediaType[]): string {\n const filteredMediaTypes = mediaTypes.filter((mediaType) => mediaType !== 'livePhotos');\n if (filteredMediaTypes.length === 0) {\n return 'image/*';\n }\n let result = '';\n for (const mediaType of filteredMediaTypes) {\n // Make sure the types don't repeat\n if (!result.includes(MediaTypeInput[mediaType])) {\n result = result.concat(',', MediaTypeInput[mediaType]);\n }\n }\n return result;\n}\n"]}
1
+ {"version":3,"file":"ExponentImagePicker.web.js","sourceRoot":"","sources":["../src/ExponentImagePicker.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,gBAAgB,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAEnF,OAAO,EACL,U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AC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,qBAAqB,CAAC,UAAuB;IACpD,MAAM,kBAAkB,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,KAAK,YAAY,CAAC,CAAC;IACxF,IAAI,kBAAkB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACpC,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,KAAK,MAAM,SAAS,IAAI,kBAAkB,EAAE,CAAC;QAC3C,mCAAmC;QACnC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC;YAChD,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC;QACzD,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import { PermissionResponse, PermissionStatus, Platform } from 'expo-modules-core';\n\nimport {\n CameraType,\n ImagePickerAsset,\n ImagePickerOptions,\n ImagePickerResult,\n MediaType,\n MediaTypeOptions,\n OpenFileBrowserOptions,\n} from './ImagePicker.types';\nimport { parseMediaTypes } from './utils';\n\nconst MediaTypeInput: Record<MediaType, string> = {\n images: 'image/*',\n videos: 'video/mp4,video/quicktime,video/x-m4v,video/*',\n livePhotos: '',\n};\n\nexport default {\n async launchImageLibraryAsync({\n mediaTypes = ['images'] as MediaType[],\n allowsMultipleSelection = false,\n base64 = false,\n }: ImagePickerOptions): Promise<ImagePickerResult> {\n // SSR guard\n if (!Platform.isDOMAvailable) {\n return { canceled: true, assets: null };\n }\n return await openFileBrowserAsync({\n mediaTypes,\n allowsMultipleSelection,\n base64,\n });\n },\n\n async launchCameraAsync({\n mediaTypes = MediaTypeOptions.Images,\n allowsMultipleSelection = false,\n base64 = false,\n cameraType,\n }: ImagePickerOptions): Promise<ImagePickerResult> {\n // SSR guard\n if (!Platform.isDOMAvailable) {\n return { canceled: true, assets: null };\n }\n return await openFileBrowserAsync({\n mediaTypes,\n allowsMultipleSelection,\n capture: cameraType ?? true,\n base64,\n });\n },\n\n /*\n * Delegate to expo-permissions to request camera permissions\n */\n async getCameraPermissionsAsync() {\n return permissionGrantedResponse();\n },\n async requestCameraPermissionsAsync() {\n return permissionGrantedResponse();\n },\n\n /*\n * Camera roll permissions don't need to be requested on web, so we always\n * respond with granted.\n */\n async getMediaLibraryPermissionsAsync(_writeOnly: boolean) {\n return permissionGrantedResponse();\n },\n async requestMediaLibraryPermissionsAsync(_writeOnly: boolean): Promise<PermissionResponse> {\n return permissionGrantedResponse();\n },\n};\n\nfunction permissionGrantedResponse(): PermissionResponse {\n return {\n status: PermissionStatus.GRANTED,\n expires: 'never',\n granted: true,\n canAskAgain: true,\n };\n}\n\nfunction openFileBrowserAsync({\n mediaTypes,\n capture = false,\n allowsMultipleSelection = false,\n base64,\n}: OpenFileBrowserOptions): Promise<ImagePickerResult> {\n const parsedMediaTypes = parseMediaTypes(mediaTypes);\n\n const mediaTypeFormat = createMediaTypeFormat(parsedMediaTypes);\n\n const input = document.createElement('input');\n input.style.display = 'none';\n input.setAttribute('type', 'file');\n input.setAttribute('accept', mediaTypeFormat);\n input.setAttribute('id', String(Math.random()));\n input.setAttribute('data-testid', 'file-input');\n if (allowsMultipleSelection) {\n input.setAttribute('multiple', 'multiple');\n }\n if (capture) {\n switch (capture) {\n case true:\n input.setAttribute('capture', 'camera');\n break;\n case CameraType.front:\n input.setAttribute('capture', 'environment');\n break;\n case CameraType.back:\n input.setAttribute('capture', 'user');\n }\n }\n document.body.appendChild(input);\n\n return new Promise((resolve) => {\n input.addEventListener('change', async () => {\n if (input.files?.length) {\n const files = allowsMultipleSelection ? input.files : [input.files[0]];\n const assets: ImagePickerAsset[] = await Promise.all(\n Array.from(files).map((file) => readFile(file, { base64 }))\n );\n\n resolve({ canceled: false, assets });\n } else {\n resolve({ canceled: true, assets: null });\n }\n document.body.removeChild(input);\n });\n input.addEventListener('cancel', () => {\n input.dispatchEvent(new Event('change'));\n });\n\n const event = new MouseEvent('click');\n input.dispatchEvent(event);\n });\n}\n\nfunction readFile(targetFile: File, options: { base64: boolean }): Promise<ImagePickerAsset> {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onerror = () => {\n reject(new Error(`Failed to read the selected media because the operation failed.`));\n };\n reader.onload = ({ target }) => {\n const uri = (target as any).result;\n const returnRaw = () => resolve({ uri, width: 0, height: 0 });\n const returnMediaData = (data: ImagePickerAsset) => {\n resolve({\n ...data,\n ...(options.base64 && { base64: uri.substr(uri.indexOf(',') + 1) }),\n file: targetFile,\n });\n };\n\n if (typeof uri === 'string') {\n if (targetFile.type.startsWith('image/')) {\n const image = new Image();\n image.src = uri;\n image.onload = () => {\n returnMediaData({\n uri,\n width: image.naturalWidth ?? image.width,\n height: image.naturalHeight ?? image.height,\n type: 'image',\n mimeType: targetFile.type,\n fileName: targetFile.name,\n fileSize: targetFile.size,\n });\n };\n image.onerror = () => returnRaw();\n } else if (targetFile.type.startsWith('video/')) {\n const video = document.createElement('video');\n video.preload = 'metadata';\n video.src = uri;\n video.onloadedmetadata = () => {\n returnMediaData({\n uri,\n width: video.videoWidth,\n height: video.videoHeight,\n type: 'video',\n mimeType: targetFile.type,\n fileName: targetFile.name,\n fileSize: targetFile.size,\n duration: video.duration,\n });\n };\n video.onerror = () => returnRaw();\n } else {\n returnRaw();\n }\n } else {\n returnRaw();\n }\n };\n\n reader.readAsDataURL(targetFile);\n });\n}\n\nfunction createMediaTypeFormat(mediaTypes: MediaType[]): string {\n const filteredMediaTypes = mediaTypes.filter((mediaType) => mediaType !== 'livePhotos');\n if (filteredMediaTypes.length === 0) {\n return 'image/*';\n }\n let result = '';\n for (const mediaType of filteredMediaTypes) {\n // Make sure the types don't repeat\n if (!result.includes(MediaTypeInput[mediaType])) {\n result = result.concat(',', MediaTypeInput[mediaType]);\n }\n }\n return result;\n}\n"]}
@@ -8,7 +8,7 @@
8
8
  "publication": {
9
9
  "groupId": "host.exp.exponent",
10
10
  "artifactId": "expo.modules.imagepicker",
11
- "version": "16.1.1",
11
+ "version": "16.1.3",
12
12
  "repository": "local-maven-repo"
13
13
  }
14
14
  }
@@ -0,0 +1 @@
1
+ 6367461a579335758001afbd99fa26d3d583efe94a557bec42eb3e9ae1275d4c
@@ -0,0 +1 @@
1
+ 98caa3e4a93ca448bda15957b57ce916da28b02909fdce5779579bdc0e3867a5fb7035c1abd8e2e1648ccce3895fdb22aff6ccac736d2977d3bd7306300b72dd
@@ -3,7 +3,7 @@
3
3
  "component": {
4
4
  "group": "host.exp.exponent",
5
5
  "module": "expo.modules.imagepicker",
6
- "version": "16.1.1",
6
+ "version": "16.1.3",
7
7
  "attributes": {
8
8
  "org.gradle.status": "release"
9
9
  }
@@ -24,13 +24,13 @@
24
24
  },
25
25
  "files": [
26
26
  {
27
- "name": "expo.modules.imagepicker-16.1.1.aar",
28
- "url": "expo.modules.imagepicker-16.1.1.aar",
29
- "size": 140394,
30
- "sha512": "f4f1141db86f00476fd0898c940437018292a357a8ec7f33392550e70604f002f1d45fdd8a5566c5409cd4add0e92a8d22532dd097daaf8ebdd8dddc920a802f",
31
- "sha256": "76179cfc1f11c053f21fff8002b29f8297bc6921c5c155ccb5effb0d99b5fe7a",
32
- "sha1": "675b928f9cbc8526291ffb834eb7cbb4629a8782",
33
- "md5": "3e61e8a2520271037bdfeae7b28d88f9"
27
+ "name": "expo.modules.imagepicker-16.1.3.aar",
28
+ "url": "expo.modules.imagepicker-16.1.3.aar",
29
+ "size": 139885,
30
+ "sha512": "98caa3e4a93ca448bda15957b57ce916da28b02909fdce5779579bdc0e3867a5fb7035c1abd8e2e1648ccce3895fdb22aff6ccac736d2977d3bd7306300b72dd",
31
+ "sha256": "6367461a579335758001afbd99fa26d3d583efe94a557bec42eb3e9ae1275d4c",
32
+ "sha1": "ec535397f3cafc3384d9029ce635649149699d86",
33
+ "md5": "63334d35ac2ff9367ac11da315a65261"
34
34
  }
35
35
  ]
36
36
  },
@@ -95,13 +95,13 @@
95
95
  ],
96
96
  "files": [
97
97
  {
98
- "name": "expo.modules.imagepicker-16.1.1.aar",
99
- "url": "expo.modules.imagepicker-16.1.1.aar",
100
- "size": 140394,
101
- "sha512": "f4f1141db86f00476fd0898c940437018292a357a8ec7f33392550e70604f002f1d45fdd8a5566c5409cd4add0e92a8d22532dd097daaf8ebdd8dddc920a802f",
102
- "sha256": "76179cfc1f11c053f21fff8002b29f8297bc6921c5c155ccb5effb0d99b5fe7a",
103
- "sha1": "675b928f9cbc8526291ffb834eb7cbb4629a8782",
104
- "md5": "3e61e8a2520271037bdfeae7b28d88f9"
98
+ "name": "expo.modules.imagepicker-16.1.3.aar",
99
+ "url": "expo.modules.imagepicker-16.1.3.aar",
100
+ "size": 139885,
101
+ "sha512": "98caa3e4a93ca448bda15957b57ce916da28b02909fdce5779579bdc0e3867a5fb7035c1abd8e2e1648ccce3895fdb22aff6ccac736d2977d3bd7306300b72dd",
102
+ "sha256": "6367461a579335758001afbd99fa26d3d583efe94a557bec42eb3e9ae1275d4c",
103
+ "sha1": "ec535397f3cafc3384d9029ce635649149699d86",
104
+ "md5": "63334d35ac2ff9367ac11da315a65261"
105
105
  }
106
106
  ]
107
107
  },
@@ -115,8 +115,8 @@
115
115
  },
116
116
  "files": [
117
117
  {
118
- "name": "expo.modules.imagepicker-16.1.1-sources.jar",
119
- "url": "expo.modules.imagepicker-16.1.1-sources.jar",
118
+ "name": "expo.modules.imagepicker-16.1.3-sources.jar",
119
+ "url": "expo.modules.imagepicker-16.1.3-sources.jar",
120
120
  "size": 21536,
121
121
  "sha512": "9bd773f058c8fe6eadb1899408da2561f5f0f5a282ac4224e0cff6d32c814f14af3789dcb3fa8af61a505a9c0fcfe7a46f7e7e12b60e9ead850a3e2bcba3b274",
122
122
  "sha256": "8fa3123644a6d7689c4adcabb5c9deb2f867ce5a03614dd0069733a6e5a84e6f",
@@ -0,0 +1 @@
1
+ ffb6992f45c48939911547e248a1a3d371f068f3986c18c8732bc6d360c6ded9
@@ -0,0 +1 @@
1
+ 7222976de5dbcb83d1d8f37ec0aa83fd0f1c5c4ace6e5ddcbb64fb4de64f0f5b9e7a6dba2617d84661e7a271c3e2ccce701de9afd270e16e27fe923b950c3c8c
@@ -9,7 +9,7 @@
9
9
  <modelVersion>4.0.0</modelVersion>
10
10
  <groupId>host.exp.exponent</groupId>
11
11
  <artifactId>expo.modules.imagepicker</artifactId>
12
- <version>16.1.1</version>
12
+ <version>16.1.3</version>
13
13
  <packaging>aar</packaging>
14
14
  <name>expo.modules.imagepicker</name>
15
15
  <url>https://github.com/expo/expo</url>
@@ -0,0 +1 @@
1
+ 61e32e63e10abcae7d774881b8d6de479742edab7f9cd1fa239d3e31e92b8402
@@ -0,0 +1 @@
1
+ 9881cdc590cf6fa4c144b0407b743c50d12d5ac1cbd67b607261ffaeaff3af6b4f6f6e339ad8ca5823e9f98af67deb79e0cf5a80b55c88ea3204e7d7cec1f416
@@ -3,11 +3,11 @@
3
3
  <groupId>host.exp.exponent</groupId>
4
4
  <artifactId>expo.modules.imagepicker</artifactId>
5
5
  <versioning>
6
- <latest>16.1.1</latest>
7
- <release>16.1.1</release>
6
+ <latest>16.1.3</latest>
7
+ <release>16.1.3</release>
8
8
  <versions>
9
- <version>16.1.1</version>
9
+ <version>16.1.3</version>
10
10
  </versions>
11
- <lastUpdated>20250409202816</lastUpdated>
11
+ <lastUpdated>20250425210750</lastUpdated>
12
12
  </versioning>
13
13
  </metadata>
@@ -1 +1 @@
1
- 027b136fcafb22d272f83bf351dbde7c
1
+ 07ca3f44cf65f0aad3de08e552ed185b
@@ -1 +1 @@
1
- 6080be07cacedaead8c9769f0c5afd2f0dc7ea6f
1
+ 7219bc9fd140602f5f25303f4b46238e35a3719b
@@ -1 +1 @@
1
- b0d9db3adb9722689aff20789bf4b5ce05b48ddf6dea43b23e9dfcfefd6a3fd0
1
+ 1d7c09c26d70f4f2d085c0bba590d330b335f65568d41bb3047d84be3f70ce12
@@ -1 +1 @@
1
- 6e0a881f6ae892ebdd767fd0f3f3dc7423b11ae8646c02aa48d9cd8dcd6b11188dd43cfb741135b345cfa81a27efded0e221777dfe67e5801f0a52001aac4a04
1
+ ebd4616129e30a37b138bf8057327f7604b3083eac8d36e9eec2132f30a50be7561a12748c21cdbb738e9ab0e6432b4cfda1a824f7f99265bd7d4916b0d42f7e
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-image-picker",
3
- "version": "16.1.1",
3
+ "version": "16.1.3",
4
4
  "description": "Provides access to the system's UI for selecting images and videos from the phone's library or taking a photo with the camera.",
5
5
  "main": "build/ImagePicker.js",
6
6
  "types": "build/ImagePicker.d.ts",
@@ -39,11 +39,11 @@
39
39
  "expo-image-loader": "~5.1.0"
40
40
  },
41
41
  "devDependencies": {
42
- "expo-module-scripts": "^4.1.1",
42
+ "expo-module-scripts": "^4.1.5",
43
43
  "@testing-library/user-event": "^14.5.2"
44
44
  },
45
45
  "peerDependencies": {
46
46
  "expo": "*"
47
47
  },
48
- "gitHead": "1914bb35d23af23078da37e70988261844436505"
48
+ "gitHead": "3cd208465df78e385ca9380531bbbfe33ca68e81"
49
49
  }
@@ -3,6 +3,7 @@ import { PermissionResponse, PermissionStatus, Platform } from 'expo-modules-cor
3
3
  import {
4
4
  CameraType,
5
5
  ImagePickerAsset,
6
+ ImagePickerOptions,
6
7
  ImagePickerResult,
7
8
  MediaType,
8
9
  MediaTypeOptions,
@@ -21,7 +22,7 @@ export default {
21
22
  mediaTypes = ['images'] as MediaType[],
22
23
  allowsMultipleSelection = false,
23
24
  base64 = false,
24
- }): Promise<ImagePickerResult> {
25
+ }: ImagePickerOptions): Promise<ImagePickerResult> {
25
26
  // SSR guard
26
27
  if (!Platform.isDOMAvailable) {
27
28
  return { canceled: true, assets: null };
@@ -38,7 +39,7 @@ export default {
38
39
  allowsMultipleSelection = false,
39
40
  base64 = false,
40
41
  cameraType,
41
- }): Promise<ImagePickerResult> {
42
+ }: ImagePickerOptions): Promise<ImagePickerResult> {
42
43
  // SSR guard
43
44
  if (!Platform.isDOMAvailable) {
44
45
  return { canceled: true, assets: null };
@@ -1 +0,0 @@
1
- 76179cfc1f11c053f21fff8002b29f8297bc6921c5c155ccb5effb0d99b5fe7a
@@ -1 +0,0 @@
1
- f4f1141db86f00476fd0898c940437018292a357a8ec7f33392550e70604f002f1d45fdd8a5566c5409cd4add0e92a8d22532dd097daaf8ebdd8dddc920a802f
@@ -1 +0,0 @@
1
- 673f6ecf4215eda9ff30bd65e498bd2f39325de8dcfa6162cf0ef32e944fb55f
@@ -1 +0,0 @@
1
- 6c1753857472707b327d12b5552f2d3fe77793fe21bc53848ac6a8a82d982c3a3c77db0b3583e4279691b3ac2321fb047d65e5d3a51f8f7e02cf05975e6f9c73
@@ -1 +0,0 @@
1
- 3fd75b736a0f6b896272016588e2700adf7a38b63531d02afa48c0c8f75c34df
@@ -1 +0,0 @@
1
- 1871e094c767316db11280e1c90614797221821ebf2dbb0a0275a36abf8361244399633861223517b7cce2c2187682422e3ada4be8fd371217960fcdec54abb3