Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit c78b4e5

Browse files
author
Chris Yang
authored
remove unnecessary file path for video (#1315)
Simplified version of #1245 fix. When pick videos, we used to create an unnecessary extra file. This PR removes the extra temp file logic.
1 parent 968e1ce commit c78b4e5

File tree

4 files changed

+12
-19
lines changed

4 files changed

+12
-19
lines changed

packages/connectivity/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import 'package:connectivity/connectivity.dart';
3333
@override
3434
initState() {
3535
super.initState();
36-
36+
3737
subscription = Connectivity().onConnectivityChanged.listen((ConnectivityResult result) {
3838
// Got a new connectivity status!
3939
})
@@ -43,7 +43,7 @@ initState() {
4343
@override
4444
dispose() {
4545
super.dispose();
46-
46+
4747
subscription.cancel();
4848
}
4949
```

packages/image_picker/CHANGELOG.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1+
## 0.5.0+9
2+
3+
* Remove unnecessary temp video file path.
4+
15
## 0.5.0+8
26

3-
* Fixed wrong GooglePhotos authority of image Uri
7+
* Fixed wrong GooglePhotos authority of image Uri.
48

59
## 0.5.0+7
10+
611
* Fix a crash when selecting images from yandex.disk and dropbox.
712

813
## 0.5.0+6
@@ -11,11 +16,11 @@
1116

1217
## 0.5.0+5
1318

14-
Remove unnecessary camera permmision.
19+
* Remove unnecessary camera permission.
1520

1621
## 0.5.0+4
1722

18-
Preserve transparency when saving images.
23+
* Preserve transparency when saving images.
1924

2025
## 0.5.0+3
2126

packages/image_picker/ios/Classes/ImagePickerPlugin.m

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -136,19 +136,7 @@ - (void)imagePickerController:(UIImagePickerController *)picker
136136
return;
137137
}
138138
if (videoURL != nil) {
139-
NSData *data = [NSData dataWithContentsOfURL:videoURL];
140-
NSString *guid = [[NSProcessInfo processInfo] globallyUniqueString];
141-
NSString *tmpFile = [NSString stringWithFormat:@"image_picker_%@.MOV", guid];
142-
NSString *tmpDirectory = NSTemporaryDirectory();
143-
NSString *tmpPath = [tmpDirectory stringByAppendingPathComponent:tmpFile];
144-
145-
if ([[NSFileManager defaultManager] createFileAtPath:tmpPath contents:data attributes:nil]) {
146-
_result(tmpPath);
147-
} else {
148-
_result([FlutterError errorWithCode:@"create_error"
149-
message:@"Temporary file could not be created"
150-
details:nil]);
151-
}
139+
_result(videoURL.description);
152140
} else {
153141
if (image == nil) {
154142
image = [info objectForKey:UIImagePickerControllerOriginalImage];

packages/image_picker/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ authors:
55
- Flutter Team <[email protected]>
66
- Rhodes Davis Jr. <[email protected]>
77
homepage: https://github.com/flutter/plugins/tree/master/packages/image_picker
8-
version: 0.5.0+8
8+
version: 0.5.0+9
99

1010
flutter:
1111
plugin:

0 commit comments

Comments
 (0)