expo-image-picker 13.0.0 → 13.0.1
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 +4 -0
- package/android/build.gradle +2 -2
- package/ios/ImagePickerModule.swift +1 -5
- package/ios/MediaHandler.swift +4 -6
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
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.0.1'
|
|
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.0.1"
|
|
78
78
|
}
|
|
79
79
|
lintOptions {
|
|
80
80
|
abortOnError false
|
|
@@ -140,21 +140,17 @@ public class ImagePickerModule: Module, OnMediaPickingResultHandler {
|
|
|
140
140
|
func didPickMedia(mediaInfo: MediaInfo) {
|
|
141
141
|
guard let options = self.currentPickingContext?.options,
|
|
142
142
|
let promise = self.currentPickingContext?.promise else {
|
|
143
|
-
|
|
143
|
+
NSLog("Picking operation context has been lost.")
|
|
144
144
|
return
|
|
145
145
|
}
|
|
146
146
|
guard let fileSystem = self.appContext?.fileSystem else {
|
|
147
147
|
return promise.reject(FileSystemModuleNotFoundException())
|
|
148
148
|
}
|
|
149
|
-
guard let logger = self.appContext?.logger else {
|
|
150
|
-
return promise.reject(LoggerModuleNotFoundException())
|
|
151
|
-
}
|
|
152
149
|
|
|
153
150
|
// Cleanup the currently stored picking context
|
|
154
151
|
self.currentPickingContext = nil
|
|
155
152
|
|
|
156
153
|
let mediaHandler = MediaHandler(fileSystem: fileSystem,
|
|
157
|
-
logger: logger,
|
|
158
154
|
options: options)
|
|
159
155
|
mediaHandler.handleMedia(mediaInfo) { result -> Void in
|
|
160
156
|
switch result {
|
package/ios/MediaHandler.swift
CHANGED
|
@@ -6,7 +6,6 @@ import Photos
|
|
|
6
6
|
|
|
7
7
|
internal struct MediaHandler {
|
|
8
8
|
internal weak var fileSystem: EXFileSystemInterface?
|
|
9
|
-
internal weak var logger: EXLogManager?
|
|
10
9
|
internal let options: ImagePickerOptions
|
|
11
10
|
|
|
12
11
|
internal func handleMedia(_ mediaInfo: MediaInfo, completion: @escaping (AsyncResult) -> Void) {
|
|
@@ -48,7 +47,7 @@ internal struct MediaHandler {
|
|
|
48
47
|
tryReadingFile: fileWasCopied,
|
|
49
48
|
shouldReadBase64: self.options.base64)
|
|
50
49
|
|
|
51
|
-
ImageUtils.optionallyReadExifFrom(mediaInfo: mediaInfo,
|
|
50
|
+
ImageUtils.optionallyReadExifFrom(mediaInfo: mediaInfo, shouldReadExif: self.options.exif) { exif in
|
|
52
51
|
let result: ImagePickerResponse = .image(ImageInfo(uri: targetUrl.absoluteString,
|
|
53
52
|
width: image.size.width,
|
|
54
53
|
height: image.size.height,
|
|
@@ -254,7 +253,6 @@ private struct ImageUtils {
|
|
|
254
253
|
|
|
255
254
|
static func optionallyReadExifFrom(
|
|
256
255
|
mediaInfo: MediaInfo,
|
|
257
|
-
logger: EXLogManager?,
|
|
258
256
|
shouldReadExif: Bool,
|
|
259
257
|
completion: @escaping (_ result: [String: Any]?) -> Void
|
|
260
258
|
) {
|
|
@@ -270,14 +268,14 @@ private struct ImageUtils {
|
|
|
270
268
|
}
|
|
271
269
|
|
|
272
270
|
guard let imageUrl = mediaInfo[.referenceURL] as? URL else {
|
|
273
|
-
|
|
271
|
+
NSLog("Could not fetch metadata for image")
|
|
274
272
|
return completion(nil)
|
|
275
273
|
}
|
|
276
274
|
|
|
277
275
|
let assets = PHAsset.fetchAssets(withALAssetURLs: [imageUrl], options: nil)
|
|
278
276
|
|
|
279
277
|
guard let asset = assets.firstObject else {
|
|
280
|
-
|
|
278
|
+
NSLog("Could not fetch metadata for image '\(imageUrl.absoluteString)'.")
|
|
281
279
|
return completion(nil)
|
|
282
280
|
}
|
|
283
281
|
|
|
@@ -287,7 +285,7 @@ private struct ImageUtils {
|
|
|
287
285
|
guard let imageUrl = input?.fullSizeImageURL,
|
|
288
286
|
let properties = CIImage(contentsOf: imageUrl)?.properties
|
|
289
287
|
else {
|
|
290
|
-
|
|
288
|
+
NSLog("Could not fetch metadata for '\(imageUrl.absoluteString)'.")
|
|
291
289
|
return completion(nil)
|
|
292
290
|
}
|
|
293
291
|
let exif = ImageUtils.readExifFrom(imageMetadata: properties)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-image-picker",
|
|
3
|
-
"version": "13.0.
|
|
3
|
+
"version": "13.0.1",
|
|
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",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"expo": "*"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "2b35d9008fef42cb53473331c37693ca12e9bf12"
|
|
50
50
|
}
|