expo-image-picker 13.0.1 → 13.2.0
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.
- package/CHANGELOG.md +26 -0
- package/README.md +46 -6
- package/android/build.gradle +4 -7
- package/android/src/main/AndroidManifest.xml +1 -1
- package/android/src/main/java/expo/modules/imagepicker/ImagePickerConstants.kt +154 -165
- package/android/src/main/java/expo/modules/imagepicker/ImagePickerExceptions.kt +35 -0
- package/android/src/main/java/expo/modules/imagepicker/ImagePickerModule.kt +144 -386
- package/android/src/main/java/expo/modules/imagepicker/ImagePickerOptions.kt +71 -53
- package/android/src/main/java/expo/modules/imagepicker/ImagePickerResponse.kt +43 -0
- package/android/src/main/java/expo/modules/imagepicker/ImagePickerUtils.kt +136 -58
- package/android/src/main/java/expo/modules/imagepicker/MediaHandler.kt +78 -0
- package/android/src/main/java/expo/modules/imagepicker/contracts/CameraContract.kt +47 -0
- package/android/src/main/java/expo/modules/imagepicker/contracts/ContractsUtils.kt +18 -0
- package/android/src/main/java/expo/modules/imagepicker/contracts/CropImageContract.kt +75 -0
- package/android/src/main/java/expo/modules/imagepicker/contracts/ImageLibraryContract.kt +41 -0
- package/android/src/main/java/expo/modules/imagepicker/exporters/CompressionImageExporter.kt +56 -46
- package/android/src/main/java/expo/modules/imagepicker/exporters/ImageExporter.kt +57 -7
- package/android/src/main/java/expo/modules/imagepicker/exporters/RawImageExporter.kt +15 -48
- package/android/src/main/java/expo/modules/imagepicker/{ImagePickerFileProvider.kt → fileprovider/ImagePickerFileProvider.kt} +1 -1
- package/build/ImagePicker.d.ts.map +1 -1
- package/build/ImagePicker.js +5 -0
- package/build/ImagePicker.js.map +1 -1
- package/build/ImagePicker.types.d.ts +18 -0
- package/build/ImagePicker.types.d.ts.map +1 -1
- package/build/ImagePicker.types.js.map +1 -1
- package/expo-module.config.json +3 -0
- package/ios/ImagePickerExceptions.swift +6 -0
- package/ios/ImagePickerHandler.swift +49 -0
- package/ios/ImagePickerModule.swift +78 -24
- package/ios/ImagePickerOptions.swift +17 -0
- package/ios/ImagePickerResponse.swift +48 -7
- package/ios/MediaHandler.swift +197 -39
- package/package.json +3 -3
- package/plugin/build/withImagePicker.d.ts +9 -7
- package/plugin/build/withImagePicker.js +58 -43
- package/plugin/src/withImagePicker.ts +80 -48
- package/src/ImagePicker.ts +7 -0
- package/src/ImagePicker.types.ts +18 -0
- package/tsconfig.json +1 -1
- package/android/src/main/java/expo/modules/imagepicker/ImagePickerPackage.kt +0 -8
- package/android/src/main/java/expo/modules/imagepicker/MediaTypes.kt +0 -16
- package/android/src/main/java/expo/modules/imagepicker/PendingPromise.kt +0 -38
- package/android/src/main/java/expo/modules/imagepicker/PickerResultsStore.kt +0 -108
- package/android/src/main/java/expo/modules/imagepicker/exporters/CropImageExporter.kt +0 -55
- package/android/src/main/java/expo/modules/imagepicker/fileproviders/CacheFileProvider.kt +0 -14
- package/android/src/main/java/expo/modules/imagepicker/fileproviders/CropFileProvider.kt +0 -8
- package/android/src/main/java/expo/modules/imagepicker/fileproviders/FileProvider.kt +0 -9
- package/android/src/main/java/expo/modules/imagepicker/tasks/ImageResultTask.kt +0 -129
- package/android/src/main/java/expo/modules/imagepicker/tasks/VideoResultTask.kt +0 -90
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,32 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 13.2.0 — 2022-07-07
|
|
14
|
+
|
|
15
|
+
### 🎉 New features
|
|
16
|
+
|
|
17
|
+
- On iOS 14+ added support for selecting multiple images/videos. ([#18102](https://github.com/expo/expo/pull/18102) by [@barthap](https://github.com/barthap))
|
|
18
|
+
|
|
19
|
+
### 🐛 Bug fixes
|
|
20
|
+
|
|
21
|
+
- Fix crash when picking a GIF image on iOS. ([#18135](https://github.com/expo/expo/pull/18135) by [@barthap](https://github.com/barthap))
|
|
22
|
+
|
|
23
|
+
### 💡 Others
|
|
24
|
+
|
|
25
|
+
- On Android migrated to the new `registerForActivityResult` mechanism. ([#17671](https://github.com/expo/expo/pull/17671), ([#17987](https://github.com/expo/expo/pull/17987) by [@bbarthec](https://github.com/bbarthec))
|
|
26
|
+
- Native module on Android is now written in Kotlin using [Sweet API](https://docs.expo.dev/modules/module-api). ([#17668](https://github.com/expo/expo/pull/17668) by [@bbarthec](https://github.com/bbarthec))
|
|
27
|
+
- Migrated Expo modules definitions to the new naming convention. ([#17193](https://github.com/expo/expo/pull/17193) by [@tsapeta](https://github.com/tsapeta))
|
|
28
|
+
|
|
29
|
+
## 13.1.1 — 2022-04-27
|
|
30
|
+
|
|
31
|
+
_This version does not introduce any user-facing changes._
|
|
32
|
+
|
|
33
|
+
## 13.1.0 — 2022-04-25
|
|
34
|
+
|
|
35
|
+
### 🎉 New features
|
|
36
|
+
|
|
37
|
+
- [plugin] Added ability to disable permissions. ([#17168](https://github.com/expo/expo/pull/17168) by [@EvanBacon](https://github.com/EvanBacon))
|
|
38
|
+
|
|
13
39
|
## 13.0.1 — 2022-04-20
|
|
14
40
|
|
|
15
41
|
_This version does not introduce any user-facing changes._
|
package/README.md
CHANGED
|
@@ -23,6 +23,8 @@ expo install expo-image-picker
|
|
|
23
23
|
|
|
24
24
|
### Configure for iOS
|
|
25
25
|
|
|
26
|
+
> This is only required for usage in bare React Native apps.
|
|
27
|
+
|
|
26
28
|
Add `NSPhotoLibraryUsageDescription`, `NSCameraUsageDescription`, and `NSMicrophoneUsageDescription` keys to your `Info.plist`:
|
|
27
29
|
|
|
28
30
|
```xml
|
|
@@ -38,6 +40,8 @@ Run `npx pod-install` after installing the npm package.
|
|
|
38
40
|
|
|
39
41
|
### Configure for Android
|
|
40
42
|
|
|
43
|
+
> This is only required for usage in bare React Native apps.
|
|
44
|
+
|
|
41
45
|
This package automatically adds the `CAMERA`, `READ_EXTERNAL_STORAGE`, and `WRITE_EXTERNAL_STORAGE` permissions. They are used when picking images from the camera directly, or from the camera roll.
|
|
42
46
|
|
|
43
47
|
```xml
|
|
@@ -47,13 +51,49 @@ This package automatically adds the `CAMERA`, `READ_EXTERNAL_STORAGE`, and `WRIT
|
|
|
47
51
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
|
48
52
|
```
|
|
49
53
|
|
|
50
|
-
|
|
54
|
+
## Config Plugin
|
|
51
55
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
56
|
+
> This plugin is applied automatically in EAS Build, only add the config plugin if you want to pass in extra properties.
|
|
57
|
+
|
|
58
|
+
After installing this npm package, add the [config plugin](https://docs.expo.io/guides/config-plugins/) to the [`plugins`](https://docs.expo.io/versions/latest/config/app/#plugins) array of your `app.json` or `app.config.js`:
|
|
59
|
+
|
|
60
|
+
```json
|
|
61
|
+
{
|
|
62
|
+
"expo": {
|
|
63
|
+
"plugins": ["expo-image-picker"]
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Next, rebuild your app as described in the ["Adding custom native code"](https://docs.expo.io/workflow/customizing/) guide.
|
|
69
|
+
|
|
70
|
+
### API
|
|
71
|
+
|
|
72
|
+
The plugin provides props for extra customization. Every time you change the props or plugins, you'll need to rebuild (and `prebuild`) the native app. If no extra properties are added, defaults will be used.
|
|
73
|
+
|
|
74
|
+
- `photosPermission` (_string | false_): Sets the iOS `NSPhotoLibraryUsageDescription` permission message to the `Info.plist`. Setting `false` will skip adding the permission on iOS and **does not** skip the permission on Android. Defaults to `Allow $(PRODUCT_NAME) to access your photos`.
|
|
75
|
+
- `cameraPermission` (_string | false_): Sets the iOS `NSCameraUsageDescription` permission message to the `Info.plist`. Setting `false` will skip adding the permission on iOS and **does not** skip the permission on Android. Defaults to `Allow $(PRODUCT_NAME) to access your camera`.
|
|
76
|
+
- `microphonePermission` (_string | false_): Sets the iOS `NSCameraUsageDescription` permission message to the `Info.plist`. Setting `false` will skip adding the permission on iOS and skips adding the `android.permission.RECORD_AUDIO` Android permission. Defaults to `Allow $(PRODUCT_NAME) to access your photos`.
|
|
77
|
+
|
|
78
|
+
### Example
|
|
79
|
+
|
|
80
|
+
```json
|
|
81
|
+
{
|
|
82
|
+
"expo": {
|
|
83
|
+
"plugins": [
|
|
84
|
+
[
|
|
85
|
+
"expo-image-picker",
|
|
86
|
+
{
|
|
87
|
+
"photosPermission": "custom photos permission",
|
|
88
|
+
"cameraPermission": "Allow $(PRODUCT_NAME) to open the camera",
|
|
89
|
+
|
|
90
|
+
"//": "Disables the microphone permission",
|
|
91
|
+
"microphonePermission": false
|
|
92
|
+
}
|
|
93
|
+
]
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
}
|
|
57
97
|
```
|
|
58
98
|
|
|
59
99
|
# Contributing
|
package/android/build.gradle
CHANGED
|
@@ -3,7 +3,7 @@ apply plugin: 'kotlin-android'
|
|
|
3
3
|
apply plugin: 'maven-publish'
|
|
4
4
|
|
|
5
5
|
group = 'host.exp.exponent'
|
|
6
|
-
version = '13.0
|
|
6
|
+
version = '13.2.0'
|
|
7
7
|
|
|
8
8
|
buildscript {
|
|
9
9
|
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
|
|
@@ -74,7 +74,7 @@ android {
|
|
|
74
74
|
minSdkVersion safeExtGet("minSdkVersion", 21)
|
|
75
75
|
targetSdkVersion safeExtGet("targetSdkVersion", 31)
|
|
76
76
|
versionCode 22
|
|
77
|
-
versionName "13.0
|
|
77
|
+
versionName "13.2.0"
|
|
78
78
|
}
|
|
79
79
|
lintOptions {
|
|
80
80
|
abortOnError false
|
|
@@ -85,11 +85,8 @@ dependencies {
|
|
|
85
85
|
implementation project(':expo-modules-core')
|
|
86
86
|
|
|
87
87
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${getKotlinVersion()}"
|
|
88
|
-
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.
|
|
89
|
-
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.
|
|
88
|
+
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.3")
|
|
89
|
+
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.3")
|
|
90
90
|
implementation "com.github.CanHub:Android-Image-Cropper:1.1.1"
|
|
91
91
|
implementation "androidx.exifinterface:exifinterface:1.3.3"
|
|
92
|
-
api "androidx.legacy:legacy-support-v4:1.0.0"
|
|
93
|
-
api 'commons-codec:commons-codec:1.10'
|
|
94
|
-
api 'commons-io:commons-io:2.6'
|
|
95
92
|
}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
android:theme="@style/Base.Theme.AppCompat"/>
|
|
15
15
|
<!-- https://developer.android.com/guide/topics/manifest/provider-element.html -->
|
|
16
16
|
<provider
|
|
17
|
-
android:name=".ImagePickerFileProvider"
|
|
17
|
+
android:name=".fileprovider.ImagePickerFileProvider"
|
|
18
18
|
android:authorities="${applicationId}.ImagePickerFileProvider"
|
|
19
19
|
android:exported="false"
|
|
20
20
|
android:grantUriPermissions="true">
|
|
@@ -4,172 +4,161 @@ import androidx.exifinterface.media.ExifInterface
|
|
|
4
4
|
|
|
5
5
|
object ImagePickerConstants {
|
|
6
6
|
const val TAG = "ExponentImagePicker"
|
|
7
|
-
const val
|
|
8
|
-
const val REQUEST_LAUNCH_IMAGE_LIBRARY = 2
|
|
9
|
-
const val DEFAULT_QUALITY = 100
|
|
7
|
+
const val MAXIMUM_QUALITY = 1.0
|
|
10
8
|
const val CACHE_DIR_NAME = "ImagePicker"
|
|
11
|
-
const val PENDING_RESULT_EVENT = "ExpoImagePicker.onPendingResult"
|
|
12
9
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const val ERR_CAN_NOT_OPEN_CROP = "ERR_CAN_NOT_OPEN_CROP"
|
|
25
|
-
const val CAN_NOT_OPEN_CROP_MESSAGE = "Can not open the crop tool."
|
|
26
|
-
const val COROUTINE_CANCELED = "Coroutine canceled by module destruction."
|
|
27
|
-
const val PROMISES_CANCELED = "Module destroyed, all promises canceled."
|
|
28
|
-
const val UNKNOWN_EXCEPTION = "Unknown exception."
|
|
29
|
-
const val ERR_CROPPING_FAILURE = "ERR_CROPPING_FAILURE"
|
|
30
|
-
const val CROPPING_FAILURE_MESSAGE = "Cropping operation failed"
|
|
10
|
+
/**
|
|
11
|
+
* Expose List<Pair<Type, Exif>> as [Iterable] for easier access.
|
|
12
|
+
*/
|
|
13
|
+
val EXIF_TAGS = object : Iterable<Pair<String, String>> {
|
|
14
|
+
/**
|
|
15
|
+
* Map { "string" | "double" | "int" -> List<String> } into List<"string" | "double" | "int", String>
|
|
16
|
+
*/
|
|
17
|
+
override fun iterator(): Iterator<Pair<String, String>> =
|
|
18
|
+
typeToTags
|
|
19
|
+
.flatMap { (type, tags) -> tags.map { tag -> type to tag } }
|
|
20
|
+
.iterator()
|
|
31
21
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
)
|
|
22
|
+
private val typeToTags = mapOf(
|
|
23
|
+
"string" to listOf(
|
|
24
|
+
ExifInterface.TAG_ARTIST,
|
|
25
|
+
ExifInterface.TAG_CFA_PATTERN,
|
|
26
|
+
ExifInterface.TAG_COMPONENTS_CONFIGURATION,
|
|
27
|
+
ExifInterface.TAG_COPYRIGHT,
|
|
28
|
+
ExifInterface.TAG_DATETIME,
|
|
29
|
+
ExifInterface.TAG_DATETIME_DIGITIZED,
|
|
30
|
+
ExifInterface.TAG_DATETIME_ORIGINAL,
|
|
31
|
+
ExifInterface.TAG_DEVICE_SETTING_DESCRIPTION,
|
|
32
|
+
ExifInterface.TAG_EXIF_VERSION,
|
|
33
|
+
ExifInterface.TAG_FILE_SOURCE,
|
|
34
|
+
ExifInterface.TAG_FLASHPIX_VERSION,
|
|
35
|
+
ExifInterface.TAG_GPS_AREA_INFORMATION,
|
|
36
|
+
ExifInterface.TAG_GPS_DATESTAMP,
|
|
37
|
+
ExifInterface.TAG_GPS_DEST_BEARING_REF,
|
|
38
|
+
ExifInterface.TAG_GPS_DEST_DISTANCE_REF,
|
|
39
|
+
ExifInterface.TAG_GPS_DEST_LATITUDE_REF,
|
|
40
|
+
ExifInterface.TAG_GPS_DEST_LONGITUDE_REF,
|
|
41
|
+
ExifInterface.TAG_GPS_H_POSITIONING_ERROR,
|
|
42
|
+
ExifInterface.TAG_GPS_IMG_DIRECTION_REF,
|
|
43
|
+
ExifInterface.TAG_GPS_LATITUDE_REF,
|
|
44
|
+
ExifInterface.TAG_GPS_LONGITUDE_REF,
|
|
45
|
+
ExifInterface.TAG_GPS_MAP_DATUM,
|
|
46
|
+
ExifInterface.TAG_GPS_MEASURE_MODE,
|
|
47
|
+
ExifInterface.TAG_GPS_PROCESSING_METHOD,
|
|
48
|
+
ExifInterface.TAG_GPS_SATELLITES,
|
|
49
|
+
ExifInterface.TAG_GPS_SPEED_REF,
|
|
50
|
+
ExifInterface.TAG_GPS_STATUS,
|
|
51
|
+
ExifInterface.TAG_GPS_TIMESTAMP,
|
|
52
|
+
ExifInterface.TAG_GPS_TRACK_REF,
|
|
53
|
+
ExifInterface.TAG_GPS_VERSION_ID,
|
|
54
|
+
ExifInterface.TAG_IMAGE_DESCRIPTION,
|
|
55
|
+
ExifInterface.TAG_IMAGE_UNIQUE_ID,
|
|
56
|
+
ExifInterface.TAG_INTEROPERABILITY_INDEX,
|
|
57
|
+
ExifInterface.TAG_MAKE,
|
|
58
|
+
ExifInterface.TAG_MAKER_NOTE,
|
|
59
|
+
ExifInterface.TAG_MODEL,
|
|
60
|
+
ExifInterface.TAG_OECF,
|
|
61
|
+
ExifInterface.TAG_RELATED_SOUND_FILE,
|
|
62
|
+
ExifInterface.TAG_SCENE_TYPE,
|
|
63
|
+
ExifInterface.TAG_SOFTWARE,
|
|
64
|
+
ExifInterface.TAG_SPATIAL_FREQUENCY_RESPONSE,
|
|
65
|
+
ExifInterface.TAG_SPECTRAL_SENSITIVITY,
|
|
66
|
+
ExifInterface.TAG_SUBSEC_TIME,
|
|
67
|
+
ExifInterface.TAG_SUBSEC_TIME_DIGITIZED,
|
|
68
|
+
ExifInterface.TAG_SUBSEC_TIME_ORIGINAL,
|
|
69
|
+
ExifInterface.TAG_USER_COMMENT,
|
|
70
|
+
),
|
|
71
|
+
"double" to listOf(
|
|
72
|
+
ExifInterface.TAG_APERTURE_VALUE,
|
|
73
|
+
ExifInterface.TAG_BRIGHTNESS_VALUE,
|
|
74
|
+
ExifInterface.TAG_COMPRESSED_BITS_PER_PIXEL,
|
|
75
|
+
ExifInterface.TAG_DIGITAL_ZOOM_RATIO,
|
|
76
|
+
ExifInterface.TAG_EXPOSURE_BIAS_VALUE,
|
|
77
|
+
ExifInterface.TAG_EXPOSURE_INDEX,
|
|
78
|
+
ExifInterface.TAG_EXPOSURE_TIME,
|
|
79
|
+
ExifInterface.TAG_FLASH_ENERGY,
|
|
80
|
+
ExifInterface.TAG_FOCAL_LENGTH,
|
|
81
|
+
ExifInterface.TAG_FOCAL_PLANE_X_RESOLUTION,
|
|
82
|
+
ExifInterface.TAG_FOCAL_PLANE_Y_RESOLUTION,
|
|
83
|
+
ExifInterface.TAG_F_NUMBER,
|
|
84
|
+
ExifInterface.TAG_GPS_ALTITUDE,
|
|
85
|
+
ExifInterface.TAG_GPS_DEST_BEARING,
|
|
86
|
+
ExifInterface.TAG_GPS_DEST_DISTANCE,
|
|
87
|
+
ExifInterface.TAG_GPS_DEST_LATITUDE,
|
|
88
|
+
ExifInterface.TAG_GPS_DEST_LONGITUDE,
|
|
89
|
+
ExifInterface.TAG_GPS_DOP,
|
|
90
|
+
ExifInterface.TAG_GPS_IMG_DIRECTION,
|
|
91
|
+
ExifInterface.TAG_GPS_LATITUDE,
|
|
92
|
+
ExifInterface.TAG_GPS_LONGITUDE,
|
|
93
|
+
ExifInterface.TAG_GPS_SPEED,
|
|
94
|
+
ExifInterface.TAG_GPS_TRACK,
|
|
95
|
+
ExifInterface.TAG_MAX_APERTURE_VALUE,
|
|
96
|
+
ExifInterface.TAG_PRIMARY_CHROMATICITIES,
|
|
97
|
+
ExifInterface.TAG_REFERENCE_BLACK_WHITE,
|
|
98
|
+
ExifInterface.TAG_SHUTTER_SPEED_VALUE,
|
|
99
|
+
ExifInterface.TAG_SUBJECT_DISTANCE,
|
|
100
|
+
ExifInterface.TAG_WHITE_POINT,
|
|
101
|
+
ExifInterface.TAG_X_RESOLUTION,
|
|
102
|
+
ExifInterface.TAG_Y_CB_CR_COEFFICIENTS,
|
|
103
|
+
ExifInterface.TAG_Y_RESOLUTION,
|
|
104
|
+
),
|
|
105
|
+
"int" to listOf(
|
|
106
|
+
ExifInterface.TAG_BITS_PER_SAMPLE,
|
|
107
|
+
ExifInterface.TAG_COLOR_SPACE,
|
|
108
|
+
ExifInterface.TAG_COMPRESSION,
|
|
109
|
+
ExifInterface.TAG_CONTRAST,
|
|
110
|
+
ExifInterface.TAG_CUSTOM_RENDERED,
|
|
111
|
+
ExifInterface.TAG_DEFAULT_CROP_SIZE,
|
|
112
|
+
ExifInterface.TAG_DNG_VERSION,
|
|
113
|
+
ExifInterface.TAG_EXPOSURE_MODE,
|
|
114
|
+
ExifInterface.TAG_EXPOSURE_PROGRAM,
|
|
115
|
+
ExifInterface.TAG_FLASH,
|
|
116
|
+
ExifInterface.TAG_FOCAL_LENGTH_IN_35MM_FILM,
|
|
117
|
+
ExifInterface.TAG_FOCAL_PLANE_RESOLUTION_UNIT,
|
|
118
|
+
ExifInterface.TAG_GAIN_CONTROL,
|
|
119
|
+
ExifInterface.TAG_GPS_ALTITUDE_REF,
|
|
120
|
+
ExifInterface.TAG_GPS_DIFFERENTIAL,
|
|
121
|
+
ExifInterface.TAG_IMAGE_LENGTH,
|
|
122
|
+
ExifInterface.TAG_IMAGE_WIDTH,
|
|
123
|
+
ExifInterface.TAG_ISO_SPEED_RATINGS,
|
|
124
|
+
ExifInterface.TAG_JPEG_INTERCHANGE_FORMAT,
|
|
125
|
+
ExifInterface.TAG_JPEG_INTERCHANGE_FORMAT_LENGTH,
|
|
126
|
+
ExifInterface.TAG_LIGHT_SOURCE,
|
|
127
|
+
ExifInterface.TAG_METERING_MODE,
|
|
128
|
+
ExifInterface.TAG_NEW_SUBFILE_TYPE,
|
|
129
|
+
ExifInterface.TAG_ORF_ASPECT_FRAME,
|
|
130
|
+
ExifInterface.TAG_ORF_PREVIEW_IMAGE_LENGTH,
|
|
131
|
+
ExifInterface.TAG_ORF_PREVIEW_IMAGE_START,
|
|
132
|
+
ExifInterface.TAG_ORIENTATION,
|
|
133
|
+
ExifInterface.TAG_PHOTOMETRIC_INTERPRETATION,
|
|
134
|
+
ExifInterface.TAG_PIXEL_X_DIMENSION,
|
|
135
|
+
ExifInterface.TAG_PIXEL_Y_DIMENSION,
|
|
136
|
+
ExifInterface.TAG_PLANAR_CONFIGURATION,
|
|
137
|
+
ExifInterface.TAG_RESOLUTION_UNIT,
|
|
138
|
+
ExifInterface.TAG_ROWS_PER_STRIP,
|
|
139
|
+
ExifInterface.TAG_RW2_ISO,
|
|
140
|
+
ExifInterface.TAG_RW2_SENSOR_BOTTOM_BORDER,
|
|
141
|
+
ExifInterface.TAG_RW2_SENSOR_LEFT_BORDER,
|
|
142
|
+
ExifInterface.TAG_RW2_SENSOR_RIGHT_BORDER,
|
|
143
|
+
ExifInterface.TAG_RW2_SENSOR_TOP_BORDER,
|
|
144
|
+
ExifInterface.TAG_SAMPLES_PER_PIXEL,
|
|
145
|
+
ExifInterface.TAG_SATURATION,
|
|
146
|
+
ExifInterface.TAG_SCENE_CAPTURE_TYPE,
|
|
147
|
+
ExifInterface.TAG_SENSING_METHOD,
|
|
148
|
+
ExifInterface.TAG_SHARPNESS,
|
|
149
|
+
ExifInterface.TAG_STRIP_BYTE_COUNTS,
|
|
150
|
+
ExifInterface.TAG_STRIP_OFFSETS,
|
|
151
|
+
ExifInterface.TAG_SUBFILE_TYPE,
|
|
152
|
+
ExifInterface.TAG_SUBJECT_AREA,
|
|
153
|
+
ExifInterface.TAG_SUBJECT_DISTANCE_RANGE,
|
|
154
|
+
ExifInterface.TAG_SUBJECT_LOCATION,
|
|
155
|
+
ExifInterface.TAG_THUMBNAIL_IMAGE_LENGTH,
|
|
156
|
+
ExifInterface.TAG_THUMBNAIL_IMAGE_WIDTH,
|
|
157
|
+
ExifInterface.TAG_TRANSFER_FUNCTION,
|
|
158
|
+
ExifInterface.TAG_WHITE_BALANCE,
|
|
159
|
+
ExifInterface.TAG_Y_CB_CR_POSITIONING,
|
|
160
|
+
ExifInterface.TAG_Y_CB_CR_SUB_SAMPLING,
|
|
161
|
+
)
|
|
162
|
+
)
|
|
163
|
+
}
|
|
175
164
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
package expo.modules.imagepicker
|
|
2
|
+
|
|
3
|
+
import androidx.core.net.toUri
|
|
4
|
+
import expo.modules.kotlin.exception.CodedException
|
|
5
|
+
import java.io.File
|
|
6
|
+
|
|
7
|
+
internal class FailedToDeduceTypeException :
|
|
8
|
+
CodedException("Can not deduce type of the returned file")
|
|
9
|
+
|
|
10
|
+
internal class FailedToCreateFileException(path: String, cause: Throwable? = null) :
|
|
11
|
+
CodedException("Failed to create the file '$path'", cause)
|
|
12
|
+
|
|
13
|
+
internal class FailedToExtractVideoMetadataException(file: File? = null, cause: Throwable? = null) :
|
|
14
|
+
CodedException("Failed to extract metadata from video file '${file?.toUri()?.toString() ?: ""}'", cause)
|
|
15
|
+
|
|
16
|
+
internal class FailedToWriteExifDataToFileException(file: File, cause: Throwable) :
|
|
17
|
+
CodedException("Failed to write EXIF data to file '${file.toUri()}", cause)
|
|
18
|
+
|
|
19
|
+
internal class FailedToWriteFileException(file: File? = null, cause: Throwable? = null) :
|
|
20
|
+
CodedException("Failed to write a file '${file?.toUri()?.toString() ?: ""}'", cause)
|
|
21
|
+
|
|
22
|
+
internal class FailedToReadFileException(file: File, cause: Throwable? = null) :
|
|
23
|
+
CodedException("Failed to read a file '${file.toUri()}", cause)
|
|
24
|
+
|
|
25
|
+
internal class MissingActivityToHandleIntent(intentType: String?) :
|
|
26
|
+
CodedException("Failed to resolve activity to handle the intent of type '$intentType'")
|
|
27
|
+
|
|
28
|
+
internal class MissingCurrentActivityException :
|
|
29
|
+
CodedException("Activity which was provided during module initialization is no longer available")
|
|
30
|
+
|
|
31
|
+
internal class MissingModuleException(moduleName: String) :
|
|
32
|
+
CodedException("Module '$moduleName' not found. Are you sure all modules are linked correctly?")
|
|
33
|
+
|
|
34
|
+
internal class UserRejectedPermissionsException :
|
|
35
|
+
CodedException("User rejected permissions")
|