dmcsdk / cordova-plugin-mediapicker Goto Github PK
View Code? Open in Web Editor NEWcordova android ios mediaPicker support selection of multiple image and video gif ✨ cordova android 和 ios 图片视频选择cordova插件,支持多图 视频 gif,ui类似微信
License: MIT License
cordova android ios mediaPicker support selection of multiple image and video gif ✨ cordova android 和 ios 图片视频选择cordova插件,支持多图 视频 gif,ui类似微信
License: MIT License
I noticed that when you go to the Album and then press Cancel without selecting an image, an error is not returned when no image is obtained. This is the code I have:
var args={
'selectMode': 100,
'maxSelectCount': 40,
};
MediaPicker.getMedias(args, function(results) {
console.log(results);
}, function (error) {
console.log('Error: ' + error);
alert("Unable to obtain pictures");
});
In the above, when the image selection is cancelled, I thought I should get the Unable to obtain pictures
alert but that doesn't work. Neither the success nor the error method is triggered when cancelled. This is the same in both iOS and Android App. How can I handle this event?
This is my ionic info:
cli packages: (/usr/local/lib/node_modules)
@ionic/cli-utils : 1.19.2
ionic (Ionic CLI) : 3.20.0
global packages:
cordova (Cordova CLI) : 8.0.0
local packages:
Cordova Platforms : android 7.0.0 ios 4.5.4
Ionic Framework : ionic1 1.3.3
System:
ios-deploy : 1.9.2
ios-sim : 5.0.13
Node : v9.3.0
npm : 5.7.1
OS : macOS High Sierra
Xcode : Xcode 9.2 Build version 9C40b
Environment Variables:
ANDROID_HOME : not set
Misc:
backend : pro
Thanks,
Neel.
Hi,
Your plugin is very good. Can you add the function of previewing pictures in IOS like Android?
When I compress the image using MediaPicker.compressImage()
, the image orientation is not preserved. I tested this from Android. These are the 2 behaviour I noticed:
When I upload the image without MediaPicker.compressImage()
, the portrait images (photos taken when the phone is vertical) are uploaded and the orientation is preserved.
When I upload the image after using MediaPicker.compressImage()
, the uploaded image appears sidewards.
So it appears, the image's orientation is not corrected after compress. Is it possible to fix the orientation after compressImage()
?
Does this plugin support video compression?
Thanx for this awesom plugin
This line is using a NSInteger pointer which doesn't make any sense. Should pass the int directly to avoid the future defect. On line 225,
[self show:0];
This is passing address 0 to the show function, And lucky converted to a int value as 0 which make it working good. But this code is not correct.
I have noticed a few crash report from a device in my ionic Android App that is using this plugin. These are the error logs:
java.lang.NullPointerException
com.dmc.mediaPickerPlugin.MediaPicker$1.run
Aug 6, 11:24 AM on app version 20010003
Kogan Agora 6 Plus (Kogan_Agora_6Plus), Android 7.0
Report 1 of 1
java.lang.NullPointerException:
at com.dmc.mediaPickerPlugin.MediaPicker$1.run (MediaPicker.java:171)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:607)
at java.lang.Thread.run (Thread.java:761)
Another one:
java.lang.IllegalArgumentException
com.dmcbig.mediapicker.view.PreviewFragment.getUri
Aug 6, 11:24 AM on app version 20010003
Kogan Agora 6 Plus (Kogan_Agora_6Plus), Android 7.0
Report 1 of 1
java.lang.IllegalArgumentException:
at android.support.v4.content.FileProvider$SimplePathStrategy.getUriForFile (FileProvider.java:712)
at android.support.v4.content.FileProvider.getUriForFile (FileProvider.java:401)
at com.dmcbig.mediapicker.view.PreviewFragment.getUri (PreviewFragment.java:98)
at com.dmcbig.mediapicker.view.PreviewFragment$2.onClick (PreviewFragment.java:84)
at android.view.View.performClick (View.java:5675)
at android.view.View$PerformClick.run (View.java:22641)
at android.os.Handler.handleCallback (Handler.java:836)
at android.os.Handler.dispatchMessage (Handler.java:103)
at android.os.Looper.loop (Looper.java:203)
at android.app.ActivityThread.main (ActivityThread.java:6247)
at java.lang.reflect.Method.invoke (Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1063)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:924)
My set-up:
cli packages: (/usr/local/lib/node_modules)
@ionic/cli-utils : 1.19.2
ionic (Ionic CLI) : 3.20.0
global packages:
cordova (Cordova CLI) : 8.0.0
local packages:
Cordova Platforms : android 7.0.0 ios 4.5.5
Ionic Framework : ionic1 1.3.3
System:
ios-deploy : 1.9.2
ios-sim : 5.0.13
Node : v9.3.0
npm : 5.7.1
OS : macOS High Sierra
Xcode : Xcode 9.2 Build version 9C40b
Environment Variables:
ANDROID_HOME : not set
Misc:
backend : pro
My Plugins:
code-push 2.0.4 "CodePushAcquisition"
cordova-android-support-gradle-release 1.4.2 "cordova-android-support-gradle-release"
cordova-plugin-appcenter-analytics 0.1.4 "App Center Analytics for Cordova"
cordova-plugin-appcenter-crashes 0.1.4 "App Center Crashes for Cordova"
cordova-plugin-appcenter-shared 0.1.3 "App Center shared code for Cordova"
cordova-plugin-camera 4.0.3 "Camera"
cordova-plugin-code-push 1.11.10 "CodePush"
cordova-plugin-device 2.0.2 "Device"
cordova-plugin-dialogs 2.0.1 "Notification"
cordova-plugin-file 6.0.1 "File"
cordova-plugin-file-opener2 2.0.19 "File Opener2"
cordova-plugin-file-transfer 1.7.1 "File Transfer"
cordova-plugin-headercolor 1.0 "HeaderColor"
cordova-plugin-ignore-lint-translation 0.0.1 "cordova-plugin-ignore-lint-translation"
cordova-plugin-ionic-webview 1.2.1 "cordova-plugin-ionic-webview"
cordova-plugin-ios-camera-permissions 1.2.0 "iOS Permissions"
cordova-plugin-mediapicker-dmcbig 2.3.0 "MediaPicker"
cordova-plugin-network-information 2.0.1 "Network Information"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-statusbar 2.4.2 "StatusBar"
cordova-plugin-whitelist 1.3.3 "Whitelist"
cordova-plugin-zip 3.1.0 "cordova-plugin-zip"
ionic-plugin-deeplinks 1.0.15 "Ionic Deeplink Plugin"
ionic-plugin-keyboard 2.2.1 "Keyboard"
May I ask, how does this plugin use the text when asking for Camera and Photo library access permission? If I have cordova-plugin-ios-camera-permissions
plugin installed, does it use the permission text defined in that?
At the moment I am using it for Android only which is no problem. But now I am gonna be using this plugin for my iOS App as well. The iOS review team rejects the app if the camera permission request does not give the exact reason on how the media will be used.
So, is it possible to add our own description for this permission request?
Hello,
First of all thank you for this plugin, it works really fine on Android en iPhone
My application must also work on iPad (version 10.3.3) but I have an issue displaying the pictures, here is what I have:
Everything works except that the image is just a blank square. When clicking on "Done", I get "null" in the console
I checked the app access and it has the "Photos" access
Can you please help me ?
Kind regards
For example the path returned is '/storage/emulated/0/Pictures/Screenshots/filename.jpeg' and this path fails when used with https://github.com/apache/cordova-plugin-file (moveFile method)
Manually adding file:// to this path could be a temporary workaround.
The related issue is #22
Firstly, great plugin, exactly what I was looking for, thanks!
I'm having an issue where this plugin seems to affect many different cordova commands. For example, I just tried to remove another redundant plugin and got the following error:
Error: npm: Command failed with exit code 1 Error output:
npm ERR! code E404
npm ERR! 404 Not Found: cordova-plugin-mediaPicker@~1.0.2
npm ERR! A complete log of this run can be found in:
The plugin is installed and working fine, so I'm not sure why it says this. I have a feeling it may be something to do with the package name, which is called 'cordova-plugin-mediapicker' in some places and 'cordova-plugin-mediapicker-dmcbig' in others, or the fact it is Android only.
To reproduce in a new Cordova project:
cordova create test com.test.app Test
cordova plugin add cordova-plugin-mediapicker-dmcbig
cordova platform add ios
cordova platform remove ios
Notice the error at this point as follows:
Error: npm: Command failed with exit code 1 Error output:
npm ERR! code E404
npm ERR! 404 Not Found: cordova-plugin-mediaPicker@~1.0.2
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/blah/.npm/_logs/2017-09-01T12_32_58_557Z-debug.log
A Similar thing happens when removing other unrelated plugins. This has the effect of not completing whatever command results in this error being output, and having to do it by hand.
Also, to remove this plugin, a different plugin name has to be used, instead of the expected:
cordova plugin remove cordova-plugin-mediapicker-dmcbig
I have to use:
cordova plugin remove cordova-plugin-mediaPicker
Do you have any ideas what could be causing this?
Thanks
Hello @DmcSDK
Can you help me to install this plugin for android
My cordova cli - 8.0.0
cordova android - 7.0.0
i am getting this error when i try to install this plugin
UnhandledPromiseRejectionWarning: CordovaError: Failed to fetch plugin git+https://github.com/DmcSDK/cordova-plugin-mediaPicker.git via registry. Probably this is either a connection problem, or plugin spec is incorrect. Check your connection and plugin name/version/URL. Failed to get absolute path to installed module at C:\Users\admin\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\plugman\fetch.js:173:37 at _rejected (C:\Users\admin\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:864:24) at C:\Users\admin\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:890:30 at Promise.when (C:\Users\admin\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:1142:31) at Promise.promise.promiseDispatch (C:\Users\admin\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:808:41) at C:\Users\admin\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:624:44 at runSingle (C:\Users\admin\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:137:13) at flush (C:\Users\admin\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:125:13) at process._tickCallback (internal/process/next_tick.js:176:11) (node:10644) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:10644) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
When I use this plugin, sometimes I receive null object and I can see following error in Xcode console:
2018-10-11 13:43:21.794117+0200 App1[3420:921019] [Generic] Failed to load image data for asset <PHAsset: 0x15f4182d0> 111CA2A1-6D86-44F0-971C-D9C606BE23A6/L0/001 mediaType=1/4, sourceType=1, (2048x1536), creationDate=2016-03-16 15:06:23 +0000, location=0, hidden=0, favorite=0 with format 9999
2018-10-11 13:43:21.948760+0200 App1[3420:920711] (null)
Any idea how to solve this issue?
Thanks
When MediaPicker is opened to choose files and when android back button is pressed it crashes the app with below error!
08-07 12:19:36.333 20198 20198 E MessageQueue-JNI: Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.view.KeyEventCompat" on path: DexPathList[[zip file "/data/app/io.ionic.starter-nfERHZ0LnobGOnMd03hSGg==/base.apk"],nativeLibraryDirectories=[/data/app/io.ionic.starter-nfERHZ0LnobGOnMd03hSGg==/lib/arm64, /data/app/io.ionic.starter-nfERHZ0LnobGOnMd03hSGg==/base.apk!/lib/arm64-v8a, /system/lib64, /system/vendor/lib64]]
08-07 12:19:36.338 20198 20198 E AndroidRuntime: Process: io.ionic.starter, PID: 20198
08-07 12:19:36.338 20198 20198 E AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.view.KeyEventCompat" on path: DexPathList[[zip file "/data/app/io.ionic.starter-nfERHZ0LnobGOnMd03hSGg==/base.apk"],nativeLibraryDirectories=[/data/app/io.ionic.starter-nfERHZ0LnobGOnMd03hSGg==/lib/arm64, /data/app/io.ionic.starter-nfERHZ0LnobGOnMd03hSGg==/base.apk!/lib/arm64-v8a, /system/lib64, /system/vendor/lib64]]
08-07 12:19:36.345 3942 7382 D ActivityManager: New dropbox entry: io.ionic.starter, data_app_crash, c466713a-321a-43f5-bacb-0d91250921ac
08-07 12:19:36.346 3942 7382 W ActivityManager: Force finishing activity io.ionic.starter/com.dmcbig.mediapicker.PickerActivity
08-07 12:19:36.353 3942 4213 I ActivityManager: Showing crash dialog for package io.ionic.starter u0
This is happening after installing some latest cordova plugins using latest android support versions and play service versions, you can check https://github.com/mapsplugin/cordova-plugin-googlemaps , this uses ANDROID_SUPPORT_V4_VERSION = (27.1.1)
also many other updated plugins use latest android support version
Steps to reproduce
any workaround or fix?
Any possible way to get the height and width of compressed image?
I'm facing problem to use this library for IOS. Android is working properly.
MediaPicker v:2.3.0
After select a image / choose cancel in any IOS version, it will return to a blank screen, cannot see my app interface anymore.
I can see this warning from xcode after initiate media picker plugin.
2018-09-20 22:29:06.803 [83080:25446518] Warning: Attempt to present <UINavigationController: 0x7fbea8029fb0> on <MainViewController: 0x7fbea5f59c90> whose view is not in the window hierarchy!
Cannot preview in IOS8, after press preview receive below error.
2018-09-20 22:25:51.895 82981:25429629] -[UIButton widthAnchor]: unrecognized selector sent to instance 0x7fc38386dfc0 2018-09-20 22:25:51.898 [82981:25429629] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIButton widthAnchor]: unrecognized selector sent to instance 0x7fc38386dfc0' *** First throw call stack: ( 0 CoreFoundation 0x000000010b830f35 __exceptionPreprocess + 165 1 libobjc.A.dylib 0x000000010b419bb7 objc_exception_throw + 45 2 CoreFoundation 0x000000010b83804d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205 3 CoreFoundation 0x000000010b79027c ___forwarding___ + 988 4 CoreFoundation 0x000000010b78fe18 _CF_forwarding_prep_0 + 120 5 Wedding Self Checkin 0x0000000109cf55a8 -[PreviewViewController initView] + 1928 6 Wedding Self Checkin 0x0000000109cf396e -[PreviewViewController viewDidLoad] + 190 7 UIKit 0x000000010c799a90 -[UIViewController loadViewIfRequired] + 738 8 UIKit 0x000000010c799c8e -[UIViewController view] + 27 9 UIKit 0x000000010c7bd507 -[UINavigationController _startCustomTransition:] + 633 10 UIKit 0x000000010c7c93fe -[UINavigationController _startDeferredTransitionIfNeeded:] + 386 11 UIKit 0x000000010c7c9f47 -[UINavigationController __viewWillLayoutSubviews] + 43 12 UIKit 0x000000010c90f509 -[UILayoutContainerView layoutSubviews] + 202 13 UIKit 0x000000010c6ed973 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 521 14 QuartzCore 0x000000010c500de8 -[CALayer layoutSublayers] + 150 15 QuartzCore 0x000000010c4f5a0e _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380 16 QuartzCore 0x000000010c4f587e _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24 17 QuartzCore 0x000000010c46363e _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 242 18 QuartzCore 0x000000010c46474a _ZN2CA11Transaction6commitEv + 390 19 QuartzCore 0x000000010c464db5 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 89 20 CoreFoundation 0x000000010b765dc7 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23 21 CoreFoundation 0x000000010b765d20 __CFRunLoopDoObservers + 368 22 CoreFoundation 0x000000010b75bb53 __CFRunLoopRun + 1123 23 CoreFoundation 0x000000010b75b486 CFRunLoopRunSpecific + 470 24 GraphicsServices 0x000000010f73f9f0 GSEventRunModal + 161 25 UIKit 0x000000010c674420 UIApplicationMain + 1282 26 Wedding Self Checkin 0x0000000109c8eb21 main + 65 27 libdyld.dylib 0x000000010ea50145 start + 1 28 ??? 0x0000000000000001 0x0 + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)
Hi,
Thank you for this plugin. I am looking for an alternative to ImagePicker plugin and I am looking forward in trying this.
Q1: I have added this to my Angular 1.5 App but I am getting the error:
ReferenceError: MediaPicker is not defined
MediaPicker.getMedias(args,function(dataArray){
console.log(dataArray);
},err())
Q2: Also, the description and your recent commit appears to show that this plugin is for iOS as well. Is that correct? Is it compatible to both Android as well as iOS?
In my App, I have 2 different buttons.
First button: Selects images only and this method uses MediaPicker.compressImage()
to compress image.
Second button: To select videos only and this method does not use compressImage()
method at all.
This is what I noticed:
When I open the App, upload video first, then it works fine.
But, when I upload an image first and then select upload video, select video and press Done, it always crashes.
In other words, the video picker crashes if I try to upload videos after I upload an image that uses compressImage()
method. My video upload does not use compressImage
obviously, and if only video is uploaded first straight after launching the app, then its fine. But it crashes if video is picked after picking images.
This is the crash error log:
05-18 18:54:21.785 32003 32408 E AndroidRuntime: FATAL EXCEPTION: pool-1-thread-2
05-18 18:54:21.785 32003 32408 E AndroidRuntime: Process: com.example.examplemobile, PID: 32003
05-18 18:54:21.785 32003 32408 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.graphics.Bitmap.compress(android.graphics.Bitmap$CompressFormat, int, java.io.OutputStream)' on a null object reference
05-18 18:54:21.785 32003 32408 E AndroidRuntime: at com.dmc.mediaPickerPlugin.MediaPicker.compressImage(MediaPicker.java:264)
05-18 18:54:21.785 32003 32408 E AndroidRuntime: at com.dmc.mediaPickerPlugin.MediaPicker.compressImage(MediaPicker.java:232)
05-18 18:54:21.785 32003 32408 E AndroidRuntime: at com.dmc.mediaPickerPlugin.MediaPicker$1.run(MediaPicker.java:161)
05-18 18:54:21.785 32003 32408 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
05-18 18:54:21.785 32003 32408 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
05-18 18:54:21.785 32003 32408 E AndroidRuntime: at java.lang.Thread.run(Thread.java:761)
环境:
问题描述:
媒体选择界面出现后,按物理Back键,主Activity会从右侧进入并再次刷新
期待效果:
类似选择图片后点击完成,媒体选择界面从右侧退出屏幕,显示出底下的主Activity
In IOS after launching mediaPicker and selecting the drop down on top to change the folder terminates the app with below error!
Is this happening because there are no other folders to show?
I tried on another phone with multiple folders present, it works.
Any help will be appreciated, thanx
WARNING: ['MediaPicker'] took '27.001953' ms. Plugin should use a background thread.
2018-08-06 00:25:55.606015+0300 NTP Live[769:6245] *** Terminating app due to uncaught exception 'NSRangeException', reason: '-[UITableView _contentOffsetForScrollingToRowAtIndexPath:atScrollPosition:usingPresentationValues:]: row (3) beyond bounds (1) for section (0).'
*** First throw call stack:
(
0 CoreFoundation 0x0000000108afe1e6 __exceptionPreprocess + 294
1 libobjc.A.dylib 0x00000001074b9031 objc_exception_throw + 48
2 CoreFoundation 0x0000000108b73975 +[NSException raise:format:] + 197
3 UIKit 0x0000000109f2d3c0 -[UITableView _contentOffsetForScrollingToRowAtIndexPath:atScrollPosition:usingPresentationValues:] + 1179
4 UIKit 0x0000000109f2e391 -[UITableView _scrollToRowAtIndexPath:atScrollPosition:animated:usingPresentationValues:] + 146
5 UIKit 0x0000000109f2e21a -[UITableView scrollToRowAtIndexPath:atScrollPosition:animated:] + 123
6 NTP Live 0x0000000104c907ff -[AlbumListView setListDataSource:dataNameSource:nowSelectAlbum:] + 479
7 NTP Live 0x0000000104c86da9 -[DmcPickerViewController titleTap:] + 1977
8 UIKit 0x000000010a3eb54f -[UIGestureRecognizerTarget _sendActionWithGestureRecognizer:] + 57
9 UIKit 0x000000010a3f4324 _UIGestureRecognizerSendTargetActions + 109
10 UIKit 0x000000010a3f1b6c _UIGestureRecognizerSendActions + 307
11 UIKit 0x000000010a3f0dc0 -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:] + 859
12 UIKit 0x000000010a3d5e24 _UIGestureEnvironmentUpdate + 1329
13 UIKit 0x000000010a3d58a7 -[UIGestureEnvironment _deliverEvent:toGestureRecognizers:usingBlock:] + 484
14 UIKit 0x000000010a3d49a9 -[UIGestureEnvironment _updateGesturesForEvent:window:] + 281
15 UIKit 0x0000000109e6a7ab -[UIWindow sendEvent:] + 4064
16 UIKit 0x0000000109e0e310 -[UIApplication sendEvent:] + 352
17 UIKit 0x000000010a74f6af __dispatchPreprocessedEventFromEventQueue + 2796
18 UIKit 0x000000010a7522c4 __handleEventQueueInternal + 5949
19 CoreFoundation 0x0000000108aa0bb1 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17
20 CoreFoundation 0x0000000108a854af __CFRunLoopDoSources0 + 271
21 CoreFoundation 0x0000000108a84a6f __CFRunLoopRun + 1263
22 CoreFoundation 0x0000000108a8430b CFRunLoopRunSpecific + 635
23 GraphicsServices 0x00000001081aba73 GSEventRunModal + 62
24 UIKit 0x0000000109df3057 UIApplicationMain + 159
25 NTP Live 0x0000000104c4f3c1 main + 65
26 libdyld.dylib 0x000000011096f955 start + 1
27 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
//medias [{mediaType: "image", path:'/storage/emulated/0/DCIM/Camera/2017.jpg', uri:"android retrun uri,ios retrun URL" size: 21993}]
Based on the documentation, the return parameter for Android is medias[0].uri, for IOS is medias[0].URL? Am I right?
I tried it seem both return as uri (medias[0].uri).
Thanks if anyone could share your experience with me.
Hi,
Your plugin works great in Android. Could you please add the support for iOS as well. It would be really helpful as these are the 2 most used platforms,
defaultSelectedList Option
Hello Sir,
Firstly, Thanks For Great Work.
Secondly,
is defaultSelectedList option work? how use it?
Can load only media in specific directory?
Best Regards
Alaa Nasr
I tested using an LG Phoenix 2, an image taken in portrait, given to me in landscape.
I'm sure the picture was actually landscape, and used exif to rotate, but I need the actual image file rotated. Can this plugin have a way to return paths to tmp files with exif rotations applied to the image instead? Or alternatively, change getMedias()
to include exifRotate
just like getThumbnail()
does? That way I don't need to make 2 calls since I don't need the thumbnail, just the rotation value.
Thanks
I was trying to see why my project size went up in size and came across this ~23MB animated gif:
/www/demo/android.gif
I would suggest reducing this file size.
MIT or Apache License 2.0
I integrated the plugin into the cordova app and under Android 6.x MediaPicker.extractThumbnail method returns an image as base64 string with line breaks and it can't be displayed using the style background-image: 'url(<thumbnail_data>)'
Once i remove the line breaks all works fine.
takePhoto方法可以使用吗,首个参数是什么呢,希望能有说明,多谢
可否提供编译好的 jar包 放到 release 里面 谢谢
Image path returned from the plugin eg ('/storage/emulated/0/DCIM/Camera/20170808_145202.jpg') can be shown in page using <img src=path>
on cordova [email protected]. But on cordova [email protected] and any version after 7+ does not show image, instead file not found!
I just need to show the selected images in the page
Any Workaround?
Thanks for this great plugin!
I'd like to resize images but it seems there's no way yet.
It'd be really awesome to some options to limits their sizes like max height = 1080, max width = 1080.
Thank you.
I am finding this hard to troubleshoot this user since I have no error logs to analyse and itunes connect does not show crash reports if its not opt-in. A user said that my app crashes as soon as she selects a photo to open using this mediapicker plugin. She is using iphone ios version 11.4.1. I could not replicate the issue and I have tried testing it on my iPhone 7 and iPhone 8 device as well as few devices in simulator and they worked fine when I tested it. I do not have any error logs for this crash report so unfortunately I do not have any more info to give you at the moment. This user says it had crashed a few times and she tried restarting her phone each time. Based on what the user had said, do you have any idea on what might be the issue here? and what can I do to troubleshoot this?
This user is having the issue with the 2.3.5 version of this plugin. I understand there isint much info to go by and Any suggestion will help. Thanks.
Bit of inconsistency with the behavior. When an image is selected in iOS, a copy is made to the application storage /tmp/dmcPicker. The copy has to be removed manually. However on Android, a direct link to the DCIM or other source directory is provided, this file shouldn't be removed since it's the original.
So for an app to work with this behavior, it would have to check if running iOS or Android, and delete temp files if iOS, or leave them if Android. It would be more intuitive and safer if both copied to a temp folder.
Thanks
This is in continuation to my previous request that was closed: #5
I am creating this since my specific request is only for the quality
option in plugin. Since the other issue was closed, here is my request information:
After trailing and testing this plugin, I have added this Media Picker plugin to my production app since it perfectly fits my need. I love the Media picker and its really awesome especially in Android. However, I really wish you would reconsider adding the quality
option to this plugin. That is 1 feature I really miss.
Most phones now-a-days have really good cameras that takes high resolution pictures. Uploading these photos in full quality takes too much time since they are huge file size. Most of the time, such high quality will not be needed in applications. For instance, I tried uploading 30 photos taken from my camera and the upload took more than 5-10 mins to complete. If the quality of the image could have been reduced to 50%, then the upload would have completed considerably faster, as less as just 2-3 mins. Can you consider adding the quality options for the image uploads, please? Or perhaps set the default quality at 50%?
With the args, am I able to add other settings like: quality, encodingType, targetWidth, targetHeight, correctOrientation, etc? In the Image Picker plugin, I used to have the options like this:
var options = {
quality: 50,
destinationType: Camera.DestinationType.FILE_URI,
sourceType: srcType,
encodingType: Camera.EncodingType.JPEG,
mediaType: Camera.MediaType.PICTURE,
targetWidth: 1800,
targetHeight: 1200,
correctOrientation: true
}
Out of the above, the main ones I want are the quality, targetWidth and encodingType (if possible). I found these reduce the uploading time by a lot since some high resolution full quality full size images can be very large.
Is that possible with this plugin? What are the args settings available other than selectMode
, maxSelectCount
and maxSelectSize
?
I get this error when building.
FAILURE: Build failed with an exception.
Manifest merger failed : Attribute application@allowBackup value=(false) from AndroidManifest.xml:5:18-45
is also present at [com.dmcBig:mediapicker:2.7] AndroidManifest.xml:15:9-35 value=(true).
Suggestion: add 'tools:replace="android:allowBackup"' to element at AndroidManifest.xml:5:5-30:19 to override.
If my manifest has android:allowBackup="false"
the build fails with that error
I have a problem with this plugin in ios 12. I can' t obtain the image when I select an image. It works well in any other version of ios . Do you have any way to solve this problem?
Hi DMC Big,
Thanks for the wonderful plugin. Could you please add this feature. It will be really useful for all.
Currently when user clicks on "ALL IMAGE" text at the bottom left, it shows the list. eg.
All Image
Camera
WhatsApp Images
Screenshots
etc.
Can you please provide the option "Google Drive / Drive". Similar to the cordova camera plugin provides
when selecting. I have attached the 2 screenshots.
This is from the current plugin(https://user-images.githubusercontent.com/10266575/42417279-d6d48b40-82a3-11e8-96a4-ac7b11607dff.png)
This is what the cordova plugin shows.(https://user-images.githubusercontent.com/10266575/42417278-d6aab0c2-82a3-11e8-9ca2-fe993ee78ea6.png). Here we can select "Drive" and select images from my drive. Since I store it in google drive, it is very much useful.
It will be really helpful for the users if we provide "Drive" option to select and upload since many of the users store their photos in drive.
Thanks!!
A user using this plugin in Android had reported that the App crashes everytime she tries to access the Photo Library. I asked the user to uninstall and reinstall the App again and she said the first time she opens the Media Picker, it asks for permission. After the permission is granted and she tries to open it, the App crashes and close down the App. She has been unable to get to the Library using the Media Picker plugin.
I am unable to reproduce the same in my phone since the plugin seems to work in the Android devices we have tested. However, this user is unable to use this plugin for her Android and it crashes. This issue is from my production app currently listed in Play store. Can you assist me please.
User's Android Set-up:
OS: android 6.0.1
Browser: chrome 66.0.3359.158
Device: android
Here is the list of all other plugins I use:
cordova-android-support-gradle-release 1.4.2 "cordova-android-support-gradle-release"
cordova-plugin-camera 4.0.3 "Camera"
cordova-plugin-device 2.0.2 "Device"
cordova-plugin-dialogs 2.0.1 "Notification"
cordova-plugin-file 6.0.1 "File"
cordova-plugin-file-opener2 2.0.19 "File Opener2"
cordova-plugin-file-transfer 1.7.1 "File Transfer"
cordova-plugin-headercolor 1.0 "HeaderColor"
cordova-plugin-ignore-lint-translation 0.0.1 "cordova-plugin-ignore-lint-translation"
cordova-plugin-ionic-webview 1.2.1 "cordova-plugin-ionic-webview"
cordova-plugin-ios-camera-permissions 1.2.0 "iOS Permissions"
cordova-plugin-network-information 2.0.1 "Network Information"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-statusbar 2.4.2 "StatusBar"
cordova-plugin-whitelist 1.3.3 "Whitelist"
ionic-plugin-deeplinks 1.0.15 "Ionic Deeplink Plugin"
ionic-plugin-keyboard 2.2.1 "Keyboard"
Here is the ionic info of my app:
cli packages: (/usr/local/lib/node_modules)
@ionic/cli-utils : 1.19.2
ionic (Ionic CLI) : 3.20.0
global packages:
cordova (Cordova CLI) : 8.0.0
local packages:
Cordova Platforms : android 7.0.0 ios 4.5.4
Ionic Framework : ionic1 1.3.3
System:
ios-deploy : 1.9.2
ios-sim : 5.0.13
Node : v9.3.0
npm : 5.7.1
OS : macOS High Sierra
Xcode : Xcode 9.2 Build version 9C40b
Environment Variables:
ANDROID_HOME : not set
Misc:
backend : pro
Could the problem be because I have used Android 7 when I built the platform but this user seems to be using Android 6.0.1? Or is the problem related to something else?
I can't acces to MediaPicker.getMedias, this return undefined.
Nothing return after select the video, however it working on IPhone 7 and IPhone 8 but it slow.
it enters getmedias but this does not return the answer with the url of the videos, in the Xcode it throws a message, but I never have a successful answer, nor an error
Xcode Message:
Status bar could not find cached time string image. Rendering in-process.
Hi,
When using RTL layout, the media picker library isn't working right:
Can you please take care of that?
Thanks.
My application creates a temp directory in Downloads directory and stores some temporary jpeg images there. When those are not needed it deletes the entire temp directory with all the files there.
However when the plugin shows the grid with images it shows empty (black) placeholder in the grid for these already deleted images and allows to select them. The problem is that since the file is selected and the plugin returns the path to non existing file and my app fails with an error.
Hi, thanks a lot for this great plugin!
What I try to do is getting images from photo library and then read EXIF data.
The problem is when I use High-Efficiency mode in the camera formats setting on my iPhone, the original image format I got with this plugin is heic not jpeg or jpg.
I can use MediaPicker.compressImage function to get a jpg format but it seems that EXIF data is stripped away after doing this.
Is it possible to get the original image with jpg or jpeg format? when I use high-efficiency mode on my iPhone setting?
Or is it possible to get jpg image with EXIF data after using compressImage function?
I really need this feature...
Thanks for your support in advance.
Can i convert the images returned from MediaPicker.getMedias
function into base64 without converting to thumbnail with MediaPicker.extractThumbnail
i mean that preserves the image size that I get it from the first function i said. Is that possible with this plugin?
I need to upload selected images and videos to my server.how can i do this?how to create file from selected items?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.