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

[image_picker] remove unnecessary file path for video. #1315

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/connectivity/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import 'package:connectivity/connectivity.dart';
@override
initState() {
super.initState();

subscription = Connectivity().onConnectivityChanged.listen((ConnectivityResult result) {
// Got a new connectivity status!
})
Expand All @@ -43,7 +43,7 @@ initState() {
@override
dispose() {
super.dispose();

subscription.cancel();
}
```
Expand Down
11 changes: 8 additions & 3 deletions packages/image_picker/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
## 0.5.0+9

* Remove unnecessary temp video file path.

## 0.5.0+8

* Fixed wrong GooglePhotos authority of image Uri
* Fixed wrong GooglePhotos authority of image Uri.

## 0.5.0+7

* Fix a crash when selecting images from yandex.disk and dropbox.

## 0.5.0+6
Expand All @@ -11,11 +16,11 @@

## 0.5.0+5

Remove unnecessary camera permmision.
* Remove unnecessary camera permission.

## 0.5.0+4

Preserve transparency when saving images.
* Preserve transparency when saving images.

## 0.5.0+3

Expand Down
14 changes: 1 addition & 13 deletions packages/image_picker/ios/Classes/ImagePickerPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -136,19 +136,7 @@ - (void)imagePickerController:(UIImagePickerController *)picker
return;
}
if (videoURL != nil) {
NSData *data = [NSData dataWithContentsOfURL:videoURL];
NSString *guid = [[NSProcessInfo processInfo] globallyUniqueString];
NSString *tmpFile = [NSString stringWithFormat:@"image_picker_%@.MOV", guid];
NSString *tmpDirectory = NSTemporaryDirectory();
NSString *tmpPath = [tmpDirectory stringByAppendingPathComponent:tmpFile];

if ([[NSFileManager defaultManager] createFileAtPath:tmpPath contents:data attributes:nil]) {
_result(tmpPath);
} else {
_result([FlutterError errorWithCode:@"create_error"
message:@"Temporary file could not be created"
details:nil]);
}
_result(videoURL.description);
} else {
if (image == nil) {
image = [info objectForKey:UIImagePickerControllerOriginalImage];
Expand Down
2 changes: 1 addition & 1 deletion packages/image_picker/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors:
- Flutter Team <[email protected]>
- Rhodes Davis Jr. <[email protected]>
homepage: https://github.com/flutter/plugins/tree/master/packages/image_picker
version: 0.5.0+8
version: 0.5.0+9

flutter:
plugin:
Expand Down