From 0a6d755ea2f6b46ce07633564b438a9ee734e244 Mon Sep 17 00:00:00 2001 From: chaves Date: Tue, 30 Nov 2021 15:28:46 +0800 Subject: [PATCH] 1.2.8 --- .idea/workspace.xml | 2 -- CHANGELOG.md | 2 ++ README.md | 2 +- .../java/com/chavesgu/images_picker/ImagesPickerPlugin.java | 5 +++++ android/src/main/java/com/chavesgu/images_picker/Utils.java | 5 ++++- example/lib/main.dart | 2 +- example/pubspec.lock | 2 +- images_picker.iml | 1 + pubspec.yaml | 2 +- 9 files changed, 16 insertions(+), 7 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 5b07894..fd7e919 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -22,9 +22,7 @@ - - diff --git a/CHANGELOG.md b/CHANGELOG.md index 822061c..16bfc63 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +## 1.2.8 +fix android filename error ## 1.2.7 fix android filename error ## 1.2.6 diff --git a/README.md b/README.md index 157b9d2..f8c7ec8 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # images_picker -[![images-picker](https://img.shields.io/badge/pub-1.2.7-orange)](https://pub.dev/packages/images_picker) +[![images-picker](https://img.shields.io/badge/pub-1.2.8-orange)](https://pub.dev/packages/images_picker) Flutter plugin for selecting images/videos from the Android and iOS image library, and taking pictures/videos with the camera,save image/video to album/gallery diff --git a/android/src/main/java/com/chavesgu/images_picker/ImagesPickerPlugin.java b/android/src/main/java/com/chavesgu/images_picker/ImagesPickerPlugin.java index 1806e9f..9f7e63e 100644 --- a/android/src/main/java/com/chavesgu/images_picker/ImagesPickerPlugin.java +++ b/android/src/main/java/com/chavesgu/images_picker/ImagesPickerPlugin.java @@ -177,6 +177,11 @@ public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) { PictureSelectionModel model = PictureSelector.create(activity) .openCamera(chooseType); model.setOutputCameraPath(context.getExternalCacheDir().getAbsolutePath()); + if (pickType.equals("PickType.image")) { + model.cameraFileName("image_picker_camera_"+UUID.randomUUID().toString()+".jpg"); + } else { + model.cameraFileName("image_picker_camera_"+UUID.randomUUID().toString()+".mp4"); + } model.recordVideoSecond(maxTime); Utils.setLanguage(model, language); Utils.setPhotoSelectOpt(model, 1, quality); diff --git a/android/src/main/java/com/chavesgu/images_picker/Utils.java b/android/src/main/java/com/chavesgu/images_picker/Utils.java index 9364cbf..a556f64 100644 --- a/android/src/main/java/com/chavesgu/images_picker/Utils.java +++ b/android/src/main/java/com/chavesgu/images_picker/Utils.java @@ -5,6 +5,7 @@ import com.luck.picture.lib.PictureSelectionModel; import com.luck.picture.lib.PictureSelector; import com.luck.picture.lib.config.PictureConfig; +import com.luck.picture.lib.config.PictureMimeType; import com.luck.picture.lib.language.LanguageConfig; import com.yalantis.ucrop.view.OverlayView; @@ -35,9 +36,11 @@ public static PictureSelectionModel setPhotoSelectOpt(PictureSelectionModel mode .setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT) .isOriginalImageControl(false) .isMaxSelectEnabledMask(true) - .cameraFileName("image_picker_camera_"+UUID.randomUUID().toString()+".jpg") + .setCameraImageFormat(PictureMimeType.JPEG) + .setCameraVideoFormat(PictureMimeType.MP4) .renameCompressFile("image_picker_compress_"+UUID.randomUUID().toString()+".jpg") .renameCropFileName("image_picker_crop_"+UUID.randomUUID().toString()+".jpg") +// .cameraFileName("image_picker_camera_"+UUID.randomUUID().toString()+".jpg") ; if (quality > 0) { model.isCompress(true).compressQuality((int) ((double) quality * 100)); diff --git a/example/lib/main.dart b/example/lib/main.dart index d4be1cf..8e6e697 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -60,7 +60,7 @@ class _MyAppState extends State { onPressed: () async { List? res = await ImagesPicker.openCamera( // pickType: PickType.video, - pickType: PickType.image, + pickType: PickType.all, quality: 0.8, maxSize: 800, // cropOpt: CropOption( diff --git a/example/pubspec.lock b/example/pubspec.lock index fc194a5..ad2ade5 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -87,7 +87,7 @@ packages: path: ".." relative: true source: path - version: "1.2.6" + version: "1.2.7" matcher: dependency: transitive description: diff --git a/images_picker.iml b/images_picker.iml index e839123..ffecf49 100644 --- a/images_picker.iml +++ b/images_picker.iml @@ -25,5 +25,6 @@ + \ No newline at end of file diff --git a/pubspec.yaml b/pubspec.yaml index a87fa43..5763ec9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: images_picker description: Flutter plugin for selecting images/videos from the Android and iOS image library, and taking pictures/videos with the camera,save image/video to album/gallery. -version: 1.2.7 +version: 1.2.8 homepage: https://github.com/chavesgu/images_picker environment: