Git Product home page Git Product logo

cordova-imagepicker's Introduction

cordova-imagePicker

Cordova Plugin For Multiple Image Selection - implemented for iOS and Android 4.0 and above.

Installing the plugin

The plugin conforms to the Cordova plugin specification, it can be installed using the Cordova / Phonegap command line interface.

phonegap plugin add cordova-plugin-image-picker

cordova plugin add cordova-plugin-image-picker

Using the plugin

The plugin creates the object window.imagePicker with the method getPictures(success, fail, options)

Example - Get Full Size Images (all default options):

window.imagePicker.getPictures(
	function(results) {
		for (var i = 0; i < results.length; i++) {
			console.log('Image URI: ' + results[i]);
		}
	}, function (error) {
		console.log('Error: ' + error);
	}
);

Example - Get at most 10 images scaled to width of 800:

window.imagePicker.getPictures(
	function(results) {
		for (var i = 0; i < results.length; i++) {
			console.log('Image URI: ' + results[i]);
		}
	}, function (error) {
		console.log('Error: ' + error);
	}, {
		maximumImagesCount: 10,
		width: 800
	}
);

Options

options = {
    // max images to be selected, defaults to 15. If this is set to 1, upon
	// selection of a single image, the plugin will return it.
	maximumImagesCount: int,
	
	// max width and height to allow the images to be.  Will keep aspect
	// ratio no matter what.  So if both are 800, the returned image
	// will be at most 800 pixels wide and 800 pixels tall.  If the width is
	// 800 and height 0 the image will be 800 pixels wide if the source
	// is at least that wide.
	width: int,
	height: int,
	
	// quality of resized image, defaults to 100
	quality: int (0-100)
};

iOS 10 issues

Starting from iOS 10, Apple started asking for specifying the reason for accessing the user’s photo library, therefore it's mandatory to add NSPhotoLibraryUsageDescription entry in the info.plist.

NSPhotoLibraryUsageDescription describes the reason that the app accesses the user’s photo library. When the system prompts the user to allow access, this string is displayed as part of the dialog box. In order to add this entry you must pass the variable PHOTO_LIBRARY_USAGE_DESCRIPTION on plugin install.

Example:

cordova plugin add cordova-plugin-image-picker --variable PHOTO_LIBRARY_USAGE_DESCRIPTION="your message"

Empty string will be added as value if you dont pass the variable

Note for Android Use

The plugin returns images that are stored in a temporary directory. These images will often not be deleted automatically though. The files should be moved or deleted after you get their filepaths in javascript.

Libraries used

ELCImagePicker

For iOS this plugin uses the ELCImagePickerController, with slight modifications for the iOS image picker. ELCImagePicker uses the MIT License which can be found in the file LICENSE.

https://github.com/B-Sides/ELCImagePickerController

MultiImageChooser

For Android this plugin uses MultiImageChooser, with modifications. MultiImageChooser uses the BSD 2-Clause License which can be found in the file BSD_LICENSE. Some code inside MultImageChooser is licensed under the Apache license which can be found in the file APACHE_LICENSE.

https://github.com/derosa/MultiImageChooser

FakeR

Code(FakeR) was also taken from the phonegap BarCodeScanner plugin. This code uses the MIT license.

https://github.com/wildabeast/BarcodeScanner

License

The MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

cordova-imagepicker's People

Contributors

allie-wake-up avatar csullivan102 avatar dmcnamara avatar f16z avatar gianpaj avatar hydrogennz avatar kristiyandobrev avatar qstarx avatar sdushay avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cordova-imagepicker's Issues

return image faster

Hi
after choosing the photos
it takes a lot of time to see them in JS,
for 30 photos it takes 30 seconds which is problematic for us :(
Can you make this time shorter somehow?

[Suggestion] localization problem

hi @TheKiteEatingTree

I am using PGB 3.4 with latest plugin 1.0.3

[suggestion 1]
no mater in ios or android
http://www.littlebau.com/Imageios1.png
http://www.littlebau.com/Imageios2.png
both of them have the white status bar,and include "OK" or "CANCEL" or....other button,if these button's word can Definitions by the javascript (maybe future),it should be more better
just like this

var ok = 'your words';
var cancel = 'your words';
...

[suggestion 2]
because of I Definitions the javascript

maximumImagesCount: X

so when I choose more than X picture,it will show a "alert windows"
"alert windows" title => Maximum X Photos
"alert windows" content => You can only select X photos at a time
if these word can Definitions by the javascript too,it will more useful to different country
just like this

var maximumImagesCount_words = 'your words';

Why Exception java.lang.VerifyError in Android 4.4.4

Exception java.lang.VerifyError in Android 4.4.4
How to solve ?

FATAL EXCEPTION: main
java.lang.VerifyError: com/synconset/MultiImageChooserActivity$ResizeImagesTask
at com.synconset.MultiImageChooserActivity.selectClicked(MultiImageChooserActivity.java:306)
at com.synconset.MultiImageChooserActivity.onItemClick(MultiImageChooserActivity.java:206)
at android.widget.AdapterView.performItemClick(AdapterView.java:299)
at android.widget.AbsListView.performItemClick(AbsListView.java:1129)
at android.widget.AbsListView$PerformClick.run(AbsListView.java:2927)
at android.widget.AbsListView$3.run(AbsListView.java:3676)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5050)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:807)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:623)
at dalvik.system.NativeStart.main(Native Method)

how to setup imagePicker Plugin

i am completely new at phonegap. so can't clearly understand how to setup this plugin in eclipse.
please provide me some useful tutorial / example so i can setup this plugin.
i tried to setup but i am getting too many errors.

Maximum Images select problem

Hi,

I have set maximumImagesCount: 20. When I select image count to 21, it popup "You can only select 20 photos at a time", I know it is normal. But after I click "OK", I can select one more photo that it haven't any popup!! Then I selected 21 photos! After it, I try to select 22 image, it pop "You can only select 20 photos at a time", after I click "OK", I can select one more photo that it haven't any popup!! Then I selected 22 photos! Etc...

How to use this plugin

Hello all,

I want to use this plugin in my app.

I have included "<gap:plugin name="com.synconset.imagepicker" />" in my config file.

and called this function getPictures()
{
alert('getPictures ');
window.imagePicker.getPictures(
function(results) {
for (var i = 0; i < results.length; i++) {
alert('Image URI: ' + results[i]);
}
}, function (error) {
alert('Error: ' + error);
}
);
}

on click event of the button.

But nothing happens.

Where I am going wrong.

Additionally I have included <script src="libs/imagepicker.js"></script> in the index file.

Please help me to get this solved.

Any help would be appreciated.

Thanks.

some issues and suggestion

I am using PGB 3.4 with latest plugin 1.0.1
https://build.phonegap.com/plugins/690

[issues]
in android,when I click the "CANCEL" button
http://www.littlebau.com/ImagePicker_crash.png
it will back to the app (good!)
but in ios,when I click the "CANCEL" button,it will alert a lot of "alert window"
http://www.littlebau.com/Imageios1.png
and every "alert window" have a character,like the "Imageios3.png"
http://www.littlebau.com/Imageios3.png

[suggestion 1]
no mater in ios or android
http://www.littlebau.com/Imageios1.png
http://www.littlebau.com/Imageios2.png
http://www.littlebau.com/ImagePicker_crash.png
both of them have the white status bar,and include "OK" or "CANCEL" or....other button,if these button's word can Definitions by the javascript (maybe future),it should be more better

[suggestion 2]
because of I Definitions the javascript

maximumImagesCount: X

so when I choose more than X picture,it will show a "alert windows"
"alert windows" title => Maximum X Photos
"alert windows" content => You can only select X photos at a time
if these word can Definitions by the javascript too,it will more useful to different country

Activity com.synconset.MultiImageChooserActivity has leaked window

I'm using v1.0.4 of the plugin and keep running into the following when selecting more than two images.

I know some work has been done on this recently, but is it possible there are still memory issues here?

Here's a copy of the logcat. Please let me know if further info is required. I'd be happy to provide any assistance.

06-25 12:33:12.219: V/WebViewInputDispatcher(6133): blockWebkitDraw
06-25 12:33:12.219: V/WebViewInputDispatcher(6133): blockWebkitDraw lockedfalse
06-25 12:33:12.254: D/CordovaActivity(6133): Paused the application!
06-25 12:33:12.254: D/CordovaWebView(6133): Handle the pause
06-25 12:33:12.254: D/WebView(6133): loadUrlImpl: called
06-25 12:33:12.254: D/webcore(6133): CORE loadUrl: called
06-25 12:33:12.259: D/webkit(6133): Firewall not null
06-25 12:33:12.259: D/webkit(6133): euler: isUrlBlocked = false
06-25 12:33:12.344: V/webview(6133): singleCursorHandlerTouchEvent -getEditableSupport FASLE
06-25 12:33:12.404: D/AbsListView(6133): Get MotionRecognitionManager
06-25 12:33:12.424: D/dalvikvm(6133): GC_FOR_ALLOC freed 164K, 31% free 8461K/12231K, paused 13ms, total 13ms
06-25 12:33:12.459: D/dalvikvm(6133): GC_CONCURRENT freed 23K, 28% free 8854K/12231K, paused 11ms+12ms, total 35ms
06-25 12:33:12.639: V/MediaStore(6133): Create the thumbnail in memory: origId=478, kind=1, isVideo=false
06-25 12:33:12.659: V/MediaStore(6133): Create the thumbnail in memory: origId=478, kind=1, isVideo=false
06-25 12:33:12.669: D/skia(6133): --- SkImageDecoder::Factory returned null
06-25 12:33:12.684: D/skia(6133): --- SkImageDecoder::Factory returned null
06-25 12:33:12.729: D/dalvikvm(6133): GC_CONCURRENT freed 71K, 24% free 9317K/12231K, paused 13ms+12ms, total 41ms
06-25 12:33:12.729: D/dalvikvm(6133): WAIT_FOR_CONCURRENT_GC blocked 24ms
06-25 12:33:12.734: D/webview(6133): blockWebkitViewMessage= false
06-25 12:33:12.789: D/dalvikvm(6133): GC_FOR_ALLOC freed 51K, 20% free 9824K/12231K, paused 25ms, total 25ms
06-25 12:33:12.834: V/MediaStore(6133): Create the thumbnail in memory: origId=478, kind=1, isVideo=false
06-25 12:33:12.844: D/skia(6133): --- SkImageDecoder::Factory returned null
06-25 12:33:12.904: W/IInputConnectionWrapper(6133): getSelectedText on inactive InputConnection
06-25 12:33:12.954: V/MediaStore(6133): Create the thumbnail in memory: origId=478, kind=1, isVideo=false
06-25 12:33:12.959: D/skia(6133): --- SkImageDecoder::Factory returned null
06-25 12:33:12.979: W/IInputConnectionWrapper(6133): setComposingText on inactive InputConnection
06-25 12:33:20.909: D/ProgressBar(6133): setProgress = 0
06-25 12:33:20.909: D/ProgressBar(6133): setProgress = 0, fromUser = false
06-25 12:33:20.909: D/ProgressBar(6133): mProgress = 0mIndeterminate = false, mMin = 0, mMax = 10000
06-25 12:33:21.004: D/dalvikvm(6133): GC_FOR_ALLOC freed 230K, 17% free 10193K/12231K, paused 24ms, total 25ms
06-25 12:33:21.024: I/dalvikvm-heap(6133): Grow heap (frag case) to 29.380MB for 19660816-byte allocation
06-25 12:33:21.039: D/dalvikvm(6133): GC_FOR_ALLOC freed 16K, 7% free 29376K/31495K, paused 13ms, total 13ms
06-25 12:33:21.074: D/dalvikvm(6133): GC_CONCURRENT freed <1K, 7% free 29377K/31495K, paused 11ms+12ms, total 36ms
06-25 12:33:22.374: D/dalvikvm(6133): GC_FOR_ALLOC freed 19274K, 68% free 10182K/31495K, paused 13ms, total 14ms
06-25 12:33:22.384: I/dalvikvm-heap(6133): Grow heap (frag case) to 29.371MB for 19660816-byte allocation
06-25 12:33:22.409: D/dalvikvm(6133): GC_FOR_ALLOC freed <1K, 7% free 29382K/31495K, paused 24ms, total 24ms
06-25 12:33:22.434: D/dalvikvm(6133): GC_CONCURRENT freed <1K, 7% free 29382K/31495K, paused 11ms+2ms, total 28ms
06-25 12:33:23.714: D/dalvikvm(6133): GC_FOR_ALLOC freed 19274K, 68% free 10182K/31495K, paused 14ms, total 14ms
06-25 12:33:23.724: I/dalvikvm-heap(6133): Grow heap (frag case) to 29.371MB for 19660816-byte allocation
06-25 12:33:23.739: D/dalvikvm(6133): GC_FOR_ALLOC freed <1K, 7% free 29382K/31495K, paused 14ms, total 14ms
06-25 12:33:23.764: D/dalvikvm(6133): GC_CONCURRENT freed <1K, 7% free 29382K/31495K, paused 11ms+2ms, total 25ms
06-25 12:33:25.089: D/dalvikvm(6133): GC_FOR_ALLOC freed 19274K, 68% free 10182K/31495K, paused 24ms, total 24ms
06-25 12:33:25.089: I/dalvikvm-heap(6133): Grow heap (frag case) to 14.527MB for 4096016-byte allocation
06-25 12:33:25.104: D/dalvikvm(6133): GC_CONCURRENT freed <1K, 55% free 14182K/31495K, paused 2ms+2ms, total 17ms
06-25 12:33:25.104: D/dalvikvm(6133): WAIT_FOR_CONCURRENT_GC blocked 9ms
06-25 12:33:25.104: D/dalvikvm(6133): WAIT_FOR_CONCURRENT_GC blocked 15ms
06-25 12:33:25.314: D/skia(6133): --- SkImageDecoder::Factory returned null
06-25 12:33:25.319: D/skia(6133): --- SkImageDecoder::Factory returned null
06-25 12:33:29.534: W/dalvikvm(6133): threadid=29: thread exiting with uncaught exception (group=0x415f72a0)
06-25 12:33:29.544: D/Sentry(6133): Writing unhandled exception to: /data/data/vhsc.genesis.android/files/Raven-1403714009550.stacktrace
06-25 12:33:29.639: D/Sentry(6133): java.lang.RuntimeException: An error occured while executing doInBackground()
06-25 12:33:29.639: D/Sentry(6133): at android.os.AsyncTask$3.done(AsyncTask.java:299)
06-25 12:33:29.639: D/Sentry(6133): at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
06-25 12:33:29.639: D/Sentry(6133): at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
06-25 12:33:29.639: D/Sentry(6133): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
06-25 12:33:29.639: D/Sentry(6133): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
06-25 12:33:29.639: D/Sentry(6133): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
06-25 12:33:29.639: D/Sentry(6133): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
06-25 12:33:29.639: D/Sentry(6133): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
06-25 12:33:29.639: D/Sentry(6133): at java.lang.Thread.run(Thread.java:856)
06-25 12:33:29.639: D/Sentry(6133): Caused by: java.lang.NullPointerException
06-25 12:33:29.639: D/Sentry(6133): at com.synconset.MultiImageChooserActivity$ResizeImagesTask.storeImage(MultiImageChooserActivity.java:593)
06-25 12:33:29.639: D/Sentry(6133): at com.synconset.MultiImageChooserActivity$ResizeImagesTask.doInBackground(MultiImageChooserActivity.java:538)
06-25 12:33:29.639: D/Sentry(6133): at com.synconset.MultiImageChooserActivity$ResizeImagesTask.doInBackground(MultiImageChooserActivity.java:1)
06-25 12:33:29.639: D/Sentry(6133): at android.os.AsyncTask$2.call(AsyncTask.java:287)
06-25 12:33:29.639: D/Sentry(6133): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
06-25 12:33:29.639: D/Sentry(6133): ... 5 more
06-25 12:33:29.644: E/AndroidRuntime(6133): FATAL EXCEPTION: AsyncTask #5
06-25 12:33:29.644: E/AndroidRuntime(6133): java.lang.RuntimeException: An error occured while executing doInBackground()
06-25 12:33:29.644: E/AndroidRuntime(6133): at android.os.AsyncTask$3.done(AsyncTask.java:299)
06-25 12:33:29.644: E/AndroidRuntime(6133): at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
06-25 12:33:29.644: E/AndroidRuntime(6133): at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
06-25 12:33:29.644: E/AndroidRuntime(6133): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
06-25 12:33:29.644: E/AndroidRuntime(6133): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
06-25 12:33:29.644: E/AndroidRuntime(6133): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
06-25 12:33:29.644: E/AndroidRuntime(6133): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
06-25 12:33:29.644: E/AndroidRuntime(6133): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
06-25 12:33:29.644: E/AndroidRuntime(6133): at java.lang.Thread.run(Thread.java:856)
06-25 12:33:29.644: E/AndroidRuntime(6133): Caused by: java.lang.NullPointerException
06-25 12:33:29.644: E/AndroidRuntime(6133): at com.synconset.MultiImageChooserActivity$ResizeImagesTask.storeImage(MultiImageChooserActivity.java:593)
06-25 12:33:29.644: E/AndroidRuntime(6133): at com.synconset.MultiImageChooserActivity$ResizeImagesTask.doInBackground(MultiImageChooserActivity.java:538)
06-25 12:33:29.644: E/AndroidRuntime(6133): at com.synconset.MultiImageChooserActivity$ResizeImagesTask.doInBackground(MultiImageChooserActivity.java:1)
06-25 12:33:29.644: E/AndroidRuntime(6133): at android.os.AsyncTask$2.call(AsyncTask.java:287)
06-25 12:33:29.644: E/AndroidRuntime(6133): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
06-25 12:33:29.644: E/AndroidRuntime(6133): ... 5 more
06-25 12:33:36.624: I/Choreographer(6133): Skipped 381 frames! The application may be doing too much work on its main thread.
06-25 12:33:36.634: D/CordovaActivity(6133): Incoming Result
06-25 12:33:36.634: D/CordovaActivity(6133): Request code = 0
06-25 12:33:36.634: D/CordovaActivity(6133): We have a callback to send this result to
06-25 12:33:36.639: I/CordovaLog(6133): Changing log level to DEBUG(3)
06-25 12:33:36.639: I/CordovaLog(6133): Found start page location: index.html
06-25 12:33:36.649: D/Whitelist(6133): Unlimited access to network resources
06-25 12:33:36.649: D/CordovaActivity(6133): Resuming the App
06-25 12:33:36.649: D/CordovaActivity(6133): CB-3064: The errorUrl is null
06-25 12:33:36.649: D/WebView(6133): loadUrlImpl: called
06-25 12:33:36.649: D/webcore(6133): CORE loadUrl: called
06-25 12:33:36.649: D/webkit(6133): Firewall not null
06-25 12:33:36.654: D/webkit(6133): euler: isUrlBlocked = false
06-25 12:33:36.824: E/WindowManager(6133): Activity com.synconset.MultiImageChooserActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@41ea62c0 that was originally added here
06-25 12:33:36.824: E/WindowManager(6133): android.view.WindowLeaked: Activity com.synconset.MultiImageChooserActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@41ea62c0 that was originally added here
06-25 12:33:36.824: E/WindowManager(6133): at android.view.ViewRootImpl.(ViewRootImpl.java:413)
06-25 12:33:36.824: E/WindowManager(6133): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:322)
06-25 12:33:36.824: E/WindowManager(6133): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:234)
06-25 12:33:36.824: E/WindowManager(6133): at android.view.WindowManagerImpl$CompatModeWrapper.addView(WindowManagerImpl.java:153)
06-25 12:33:36.824: E/WindowManager(6133): at android.view.Window$LocalWindowManager.addView(Window.java:559)
06-25 12:33:36.824: E/WindowManager(6133): at android.app.Dialog.show(Dialog.java:278)
06-25 12:33:36.824: E/WindowManager(6133): at com.synconset.MultiImageChooserActivity.selectClicked(MultiImageChooserActivity.java:299)
06-25 12:33:36.824: E/WindowManager(6133): at com.synconset.MultiImageChooserActivity$3.onClick(MultiImageChooserActivity.java:346)
06-25 12:33:36.824: E/WindowManager(6133): at android.view.View.performClick(View.java:4261)
06-25 12:33:36.824: E/WindowManager(6133): at android.view.View$PerformClick.run(View.java:17420)
06-25 12:33:36.824: E/WindowManager(6133): at android.os.Handler.handleCallback(Handler.java:615)
06-25 12:33:36.824: E/WindowManager(6133): at android.os.Handler.dispatchMessage(Handler.java:92)
06-25 12:33:36.824: E/WindowManager(6133): at android.os.Looper.loop(Looper.java:137)
06-25 12:33:36.824: E/WindowManager(6133): at android.app.ActivityThread.main(ActivityThread.java:4938)
06-25 12:33:36.824: E/WindowManager(6133): at java.lang.reflect.Method.invokeNative(Native Method)
06-25 12:33:36.824: E/WindowManager(6133): at java.lang.reflect.Method.invoke(Method.java:511)
06-25 12:33:36.824: E/WindowManager(6133): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038)
06-25 12:33:36.824: E/WindowManager(6133): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)
06-25 12:33:36.824: E/WindowManager(6133): at dalvik.system.NativeStart.main(Native Method)

Phonegap Build Support

Hi, this plugin is very interesting, but for my particular project I can only use the Phonegap Build service by Adobe; I've tried to submit your plugin repo to build.phonegap.com, but without any success;
Can You help me please?!
Thanks in advance!

[Suggestion] Allow browsing by folders just like the G+ "select photos" screen

I am using this plugin for my app. Thanks!

I wish it would allow me to browse the folders on my device with thumbnails of images in each folder, just like the Google G+ app does when you click on the 'Photo' button in the main screen.

The G+ screen has all the images (like this app does) but it also has a 'Folders' button and when you click it it goes to a list of folders on the device with a thumbnail of an image in the folder for each folder, and when you click it it goes into that folder with thumbnails of images....

How would one implement this? I am new to android development.

Many thanks!

Update for iOS 8

According to Shazron's blog, plugins that use the camera should use the new iOS 8 Geolocation permissions. "If not updated, it will silently fail for new jpgs and you won’t get the pic."

Please update this plugin to use the iOS 8 geolocation permissions (if needed, which I think it is). Here's the Github commit for the fix for the similar camera plugin.

Returned image order

Currently it looks as though images are returned in the order that they appear in the user's photo album.

Is there anyway to have images returned in the order that they were selected?

IOS8.3 not supported

The following build commands failed:
CompileXIB testapp/Resources/ELCAlbumPickerController.xib
CompileXIB testapp/Resources/ELCAssetPicker.xib
CompileXIB testapp/Resources/ELCAssetTablePicker.xib
CpResource testapp/Resources/Overlay.png build/emulator/testapp.app/Overlay.png
(4 failures)

Unselectable photos and empty albums when Optimized Storage is enabled

On iOS 8.2, when the feature "Optimized Storage" is enabled the idea is that all thumbnails are stored on the phone and fullres are in the cloud. With this feature enabled, in the ImagePicker, some of these photo's aren't even selectable. Some albums are even entirely empty.

This can be demonstrated on iOS 8.2 with the following sample code:

window.imagePicker.getPictures(
    function (results) {
        for (var i = 0; i < results.length; i++) {
            console.log('Image URI: ' + results[i]);
        }
    }, function (error) {
        // no error occurs; it's a visual thing ;)
    }
);

In short, there seems to be odd behaviour when using shared/streamed albums on iOS.

How to keep the original file?

If I look into the file path of the images imported via ImagePicker, I see that the file names were renamed to cdv_photo_XX.jpg where XX stands for the number of the image, no matter what the original file name of that image was before I imported it via iTunes on my iOS device.

Is there any way to preserve the file name in the path or at least read out the original filename from some meta info data?

Returning original image using NATIVE_URI, instead of stripped copy

The plugin works great. However, it creates a copy of the image file for further processing. This strips out the original metadata of the image, like the EXIF details. Is it possible to not create a copy, and simply return theCamera.DestinationType.NATIVE_URI instead?

By using the NATIVE_URI, the original file (path) is returned - e.g., assets-library:// on iOS or content:// on Android - and allows processing of the native file, including EXIF data. This has also been fixed in recent Cordova updates, so it's obvious this hasn't been used before.

Ideally, an option like for example useOriginal: true, or the quality: 100 to preserve backwards compatability would be a nice solution in my opinion,.

@wymsee: I'm also interested in digging through the code here a bit, but would love some input if this is advisable (and perhaps a bit of a tip where to fix this). Any tips?

Image orientation problem

Hi,

I have a problem with the image orientation. When I view a landscape image in or as a background-image, it's displayed in portrait mode e.g. rotated 90 degrees. But if I use the following code to get the dimensions if the image, it returns the correct width and height.

It works correctly in iOS simulator with the default example pictures, but not when I run it on the device.

function getImageDimensions(image) {
    var img = new Image();
    img.src = image.uri;

    return {
        width: img.width,
        height: img.height,
        ratio: img.width / img.height,
        isLandscape: img.width > img.height,
        isPortrait: img.width < img.height,
        resolution: img.width * img.height
    };
}

The return object looks like this:

{
height: 2448
isLandscape: true
isPortrait: false
ratio: 1.3333333333333333
resolution: 7990272
width: 3264
}

Thank you in advance!

[Suggestion] Back to selected image screen from App

Hi @TheKiteEatingTree,

May I know is there anywhere can I back to selected image screen after user clicked "OK" and linked back to App,but from my own app screen, how to back to gallery with selected images screen?

Android 5.0 Nexus 5 Undefined method

I have a rather unusual setup in which I am using Meteorjs with this wrapped cordova package. When testing on my running Nexus 5 running Android 5.0 I am getting 'undefined' when trying to run window.imagePicker.

Can anyone else confirm this works on Android 5.0?
I can confirm this works on version 4.4.2.

Causes phonegap-facebook-plugin to stop working on Android

When I install the cordova-imagePicker plugin, then I try to log in to Facebook on Android using the phonegap-facebook-plugin, I get an "Unfortunately, appname has stopped." error.

When I remove the cordova-imagePicker plugin, logging in to Facebook works again.

adb logcat output:

E/eglCodecCommon( 2602): glUtilsParamSize: unknow param 0x00000b44
E/eglCodecCommon( 2602): glUtilsParamSize: unknow param 0x00000bd0
E/eglCodecCommon( 2602): **** ERROR unknown type 0x690057 (glSizeof,72)
E/eglCodecCommon( 2602): **** ERROR unknown type 0x6e0061 (glSizeof,72)
D/ConnectPlugin( 2602): login FB
D/dalvikvm( 2602): GC_CONCURRENT freed 383K, 12% free 4285K/4840K, paused 7ms+0ms, total 10ms
D/CordovaActivity( 2602): Paused the application!
D/CordovaWebView( 2602): Handle the pause
E/ActivityThread( 2602): Failed to find provider info for com.facebook.katana.provider.AttributionIdProvider
I/ActivityManager( 1273): START u0 {act=SSO_WITH_FALLBACK cmp=com.ning.phoenix/com.facebook.LoginActivity (has extras)} from pid 2602
D/dalvikvm( 2602): GC_CONCURRENT freed 187K, 9% free 4484K/4920K, paused 16ms+0ms, total 18ms
W/PluginManager( 2602): THREAD WARNING: exec() call to FacebookConnectPlugin.login blocked the main thread for 73ms. Plugin should use CordovaInterface.getThreadPool().
E/ActivityThread( 2602): Failed to find provider info for com.facebook.katana.provider.PlatformProvider
E/ActivityThread( 2602): Failed to find provider info for com.facebook.wakizashi.provider.PlatformProvider
D/Request ( 2602): Warning: Sessionless Request needs token but missing either application ID or client token.
W/ResourceType( 2602): getEntry failing because entryIndex 17 is beyond type entryCount 7
W/ResourceType( 2602): Failure getting entry for 0x7f080011 (t=7 e=17) in package 0 (error -2147483647)
D/AndroidRuntime( 2602): Shutting down VM
W/dalvikvm( 2602): threadid=1: thread exiting with uncaught exception (group=0xb0ce0b20)
E/AndroidRuntime( 2602): FATAL EXCEPTION: main
E/AndroidRuntime( 2602): Process: com.ning.phoenix, PID: 2602
E/AndroidRuntime( 2602): java.lang.RuntimeException: Unable to resume activity {com.ning.phoenix/com.facebook.LoginActivity}: android.content.res.Resources$NotFoundException: String resource ID #0x7f080011
E/AndroidRuntime( 2602):    at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2788)
E/AndroidRuntime( 2602):    at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2817)
E/AndroidRuntime( 2602):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2250)
E/AndroidRuntime( 2602):    at android.app.ActivityThread.access$800(ActivityThread.java:135)
E/AndroidRuntime( 2602):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
E/AndroidRuntime( 2602):    at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime( 2602):    at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime( 2602):    at android.app.ActivityThread.main(ActivityThread.java:5017)
E/AndroidRuntime( 2602):    at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 2602):    at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime( 2602):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
E/AndroidRuntime( 2602):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
E/AndroidRuntime( 2602):    at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 2602): Caused by: android.content.res.Resources$NotFoundException: String resource ID #0x7f080011
E/AndroidRuntime( 2602):    at android.content.res.Resources.getText(Resources.java:244)
E/AndroidRuntime( 2602):    at android.content.res.Resources.getString(Resources.java:330)
E/AndroidRuntime( 2602):    at android.content.Context.getString(Context.java:343)
E/AndroidRuntime( 2602):    at com.facebook.widget.WebDialog.onCreate(WebDialog.java:208)
E/AndroidRuntime( 2602):    at android.app.Dialog.dispatchOnCreate(Dialog.java:361)
E/AndroidRuntime( 2602):    at android.app.Dialog.show(Dialog.java:262)
E/AndroidRuntime( 2602):    at com.facebook.AuthorizationClient$WebViewAuthHandler.tryAuthorize(AuthorizationClient.java:628)
E/AndroidRuntime( 2602):    at com.facebook.AuthorizationClient.tryCurrentHandler(AuthorizationClient.java:264)
E/AndroidRuntime( 2602):    at com.facebook.AuthorizationClient.tryNextHandler(AuthorizationClient.java:230)
E/AndroidRuntime( 2602):    at com.facebook.AuthorizationClient.authorize(AuthorizationClient.java:154)
E/AndroidRuntime( 2602):    at com.facebook.AuthorizationClient.startOrContinueAuth(AuthorizationClient.java:135)
E/AndroidRuntime( 2602):    at com.facebook.LoginActivity.onResume(LoginActivity.java:117)
E/AndroidRuntime( 2602):    at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1192)
E/AndroidRuntime( 2602):    at android.app.Activity.performResume(Activity.java:5310)
E/AndroidRuntime( 2602):    at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2778)
E/AndroidRuntime( 2602):    ... 12 more
W/ActivityManager( 1273):   Force finishing activity com.ning.phoenix/com.facebook.LoginActivity
W/ActivityManager( 1273):   Force finishing activity com.ning.phoenix/.Ning
D/Request ( 2602): Warning: Sessionless Request needs token but missing either application ID or client token.
W/ActivityManager( 1273): Activity pause timeout for ActivityRecord{b13bff28 u0 com.ning.phoenix/com.facebook.LoginActivity t9 f}
W/EGL_emulation( 1407): eglSurfaceAttrib not implemented
D/dalvikvm( 2602): GC_CONCURRENT freed 335K, 10% free 4576K/5084K, paused 8ms+0ms, total 10ms
F/ProcessStats( 1273): ProcessState dead: name=com.android.systemui pkg=com.android.keyguard uid=10007 common.name=com.android.systemui
F/ProcessStats( 1273): android.util.Log$TerribleFailure: ProcessState dead: name=com.android.systemui pkg=com.android.keyguard uid=10007 common.name=com.android.systemui
F/ProcessStats( 1273):  at android.util.Log.wtf(Log.java:290)
F/ProcessStats( 1273):  at android.util.Slog.wtfStack(Slog.java:86)
F/ProcessStats( 1273):  at com.android.internal.app.ProcessStats$ProcessState.ensureNotDead(ProcessStats.java:2495)
F/ProcessStats( 1273):  at com.android.internal.app.ProcessStats$ProcessState.setState(ProcessStats.java:2593)
F/ProcessStats( 1273):  at com.android.internal.app.ProcessStats$ProcessState.setState(ProcessStats.java:2578)
F/ProcessStats( 1273):  at com.android.server.am.ActivityManagerService.setProcessTrackerState(ActivityManagerService.java:15348)
F/ProcessStats( 1273):  at com.android.server.am.ActivityManagerService.updateOomAdjLocked(ActivityManagerService.java:15722)
F/ProcessStats( 1273):  at com.android.server.am.ActivityStack.destroyActivityLocked(ActivityStack.java:2803)
F/ProcessStats( 1273):  at com.android.server.am.ActivityStackSupervisor.activityIdleInternalLocked(ActivityStackSupervisor.java:1916)
F/ProcessStats( 1273):  at com.android.server.am.ActivityManagerService.activityIdle(ActivityManagerService.java:5074)
F/ProcessStats( 1273):  at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:409)
F/ProcessStats( 1273):  at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2071)
F/ProcessStats( 1273):  at android.os.Binder.execTransact(Binder.java:404)
F/ProcessStats( 1273):  at dalvik.system.NativeStart.run(Native Method)

Class not found

I am a bit of a newbie in Cordova plugins so, I think i have installed everything correctly, but i keep getting "Class not found" when i try to call window.imagePicker.getPictures

I have put all java files in my src directory and copied and paste the res files as well. The imagePicker.js file is in my www folder and is included in my html file.

Maybe i need to add a plugin in the xml file where the other permissions are? I have no idea. Can someone please help me?

Thx
Maurice

Browse Videos

Great work!
Would be nice to have also videos multiselect

outofmemory

Hi,

Even if I select one photo, I get the folowing error. My phone is samsung s4 mini. Android 4.2.2.
I can run any other program, no memory problem occurs. Any suggestions?

08-08 16:42:55.745: E/AndroidRuntime(28036): FATAL EXCEPTION: AsyncTask #4
08-08 16:42:55.745: E/AndroidRuntime(28036): java.lang.RuntimeException: An error occured while executing doInBackground()
08-08 16:42:55.745: E/AndroidRuntime(28036): at android.os.AsyncTask$3.done(AsyncTask.java:299)
08-08 16:42:55.745: E/AndroidRuntime(28036): at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:352)
08-08 16:42:55.745: E/AndroidRuntime(28036): at java.util.concurrent.FutureTask.setException(FutureTask.java:219)
08-08 16:42:55.745: E/AndroidRuntime(28036): at java.util.concurrent.FutureTask.run(FutureTask.java:239)
08-08 16:42:55.745: E/AndroidRuntime(28036): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
08-08 16:42:55.745: E/AndroidRuntime(28036): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
08-08 16:42:55.745: E/AndroidRuntime(28036): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
08-08 16:42:55.745: E/AndroidRuntime(28036): at java.lang.Thread.run(Thread.java:856)
08-08 16:42:55.745: E/AndroidRuntime(28036): Caused by: java.lang.OutOfMemoryError
08-08 16:42:55.745: E/AndroidRuntime(28036): at android.graphics.Bitmap.nativeCreate(Native Method)
08-08 16:42:55.745: E/AndroidRuntime(28036): at android.graphics.Bitmap.createBitmap(Bitmap.java:718)
08-08 16:42:55.745: E/AndroidRuntime(28036): at android.graphics.Bitmap.createBitmap(Bitmap.java:695)
08-08 16:42:55.745: E/AndroidRuntime(28036): at android.graphics.Bitmap.createBitmap(Bitmap.java:628)
08-08 16:42:55.745: E/AndroidRuntime(28036): at com.synconset.MultiImageChooserActivity$ResizeImagesTask.doInBackground(MultiImageChooserActivity.java:535)
08-08 16:42:55.745: E/AndroidRuntime(28036): at com.synconset.MultiImageChooserActivity$ResizeImagesTask.doInBackground(MultiImageChooserActivity.java:485)
08-08 16:42:55.745: E/AndroidRuntime(28036): at android.os.AsyncTask$2.call(AsyncTask.java:287)
08-08 16:42:55.745: E/AndroidRuntime(28036): at java.util.concurrent.FutureTask.run(FutureTask.java:234)
08-08 16:42:55.745: E/AndroidRuntime(28036): ... 4 more
08-08 16:42:56.085: E/android.os.Debug(775): !@dumpstate > sdumpstate -k -t -z -d -o /data/log/dumpstate_app_error

The app crash on Kitkat randomly when selecting photos

After selecting photos and clicking the button OK, the app is crashing randomly on Android.

It is happening on two different phones powered by Kitkat (4.4.2).
With Ice Cream Sandwich and Jelly Bean, I am not having any problem.

Is someone experiencing the same error and knows a way to solve it ?

I got this stacktrace in eclipse:

05-27 13:40:39.825: E/WindowManager(21871): android.view.WindowLeaked: Activity com.synconset.MultiImageChooserActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView{421e2758 V.E..... R......D 0,0-684,324} that was originally added here
05-27 13:40:39.825: E/WindowManager(21871): at android.view.ViewRootImpl.(ViewRootImpl.java:361)
05-27 13:40:39.825: E/WindowManager(21871): at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:248)
05-27 13:40:39.825: E/WindowManager(21871): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
05-27 13:40:39.825: E/WindowManager(21871): at android.app.Dialog.show(Dialog.java:286)
05-27 13:40:39.825: E/WindowManager(21871): at com.synconset.MultiImageChooserActivity.selectClicked(MultiImageChooserActivity.java:305)
05-27 13:40:39.825: E/WindowManager(21871): at com.synconset.MultiImageChooserActivity$3.onClick(MultiImageChooserActivity.java:353)
05-27 13:40:39.825: E/WindowManager(21871): at android.view.View.performClick(View.java:4456)
05-27 13:40:39.825: E/WindowManager(21871): at android.view.View$PerformClick.run(View.java:18462)
05-27 13:40:39.825: E/WindowManager(21871): at android.os.Handler.handleCallback(Handler.java:733)
05-27 13:40:39.825: E/WindowManager(21871): at android.os.Handler.dispatchMessage(Handler.java:95)
05-27 13:40:39.825: E/WindowManager(21871): at android.os.Looper.loop(Looper.java:136)
05-27 13:40:39.825: E/WindowManager(21871): at android.app.ActivityThread.main(ActivityThread.java:5102)
05-27 13:40:39.825: E/WindowManager(21871): at java.lang.reflect.Method.invokeNative(Native Method)
05-27 13:40:39.825: E/WindowManager(21871): at java.lang.reflect.Method.invoke(Method.java:515)
05-27 13:40:39.825: E/WindowManager(21871): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
05-27 13:40:39.825: E/WindowManager(21871): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
05-27 13:40:39.825: E/WindowManager(21871): at dalvik.system.NativeStart.main(Native Method)

Thanks,

Support base 64 image

Hi, i love your plugin so much. But is this plugin support return base 64 instead of getting file path? btw hw to delete temporary image?

iOS 8.3 issue

works perfectly on my app for android, however for iOS just throws error "index.html TypeError: undefined is not an object (evaluating 'window.imagePicker.getPictures')

Picker doesn't show second time selected in iOS

I'm using the plugin with Cordova/Ionic, and am running into a problem - after canceling or choosing a photo once, I receive this error when attempting to show the picker a second time:

Warning: Attempt to present ELCImagePickerController: 0x135e29a60 on MainViewController: 0x135d10e90 while a presentation is in progress!

This is iOS only, Android works fine. Odder still, when I hit the home button and return to the app, the picker appears.. Perhaps it has something to do with either of these issues:

http://stackoverflow.com/questions/14453001/meaning-of-warning-while-a-presentation-is-in-progress
http://stackoverflow.com/questions/13642272/ios-warning-attempt-to-present-modalviewcontroller-on-viewcontrollerwhile

Unable to set maximumImagescount to 1 in Android

Set to >= 2 is ok, if set to 1, in android, the following error message appears: "Get Picture Error: Cannot call method 'getPictures' of undefined". My javascript code is as follow:

function MeBtnGetPicture() {
try {
window.imagePicker.getPictures(
function (results) {
for (var i = 0; i < results.length; i++) {
alert('Image URI: ' + results[i]);
}
}, function (error) {
alert('Error: ' + error);
}, {
maximumImagesCount: 1,
width: 100
}
);
} catch (err) {
alert("Get Picture Error:" + err.message);
}
}

app will crash in Android and "null" value in ios

when I use this method

window.imagePicker.getPictures(
    function(results) {
        for (var i = 0; i < results.length; i++) {
            alert('Image URI: ' + results[i]);
        }
    }, function (error) {
        alert('Error: ' + error);
    }, {
        maximumImagesCount: 10,
        width: 800
    }
);

in Android
it will immediately crash the app
http://www.littlebau.com/ImagePicker_crash.png

in ios
it always alert the "null"
http://www.littlebau.com/ImagePicker_ios01.png
http://www.littlebau.com/ImagePicker_ios02.png

finally~I found a way to solve the ios problem
it must be add a "height" attribute

{
maximumImagesCount: 10,
width: 800,
height: 600,
}

otherwise it will always got a "null" value (for now)

Images turning sideways/upside down on upload

I am using this plugin and it works great! I encountered one issue though. Photos are displayed in the correct orientation, however, when it gets uploaded to a server, some are showing sideways/upside down. (I am testing on Android)

I saw the below stackoverflow entry and it seems the solution is by using the camera option correctOrientation: true.

http://stackoverflow.com/questions/9353629/images-turning-sideways-upside-down-after-being-uploaded-via-phonegap-ios

In your plugin, is it possible to add correctOrientation as part of the options?

Multiple Photo Upload Slow in Android

Previously this function is working perfectly in Android and IOS,now it's not working on Android. Currently I have 2 file upload, first file upload needs 6 images and the other one is 7 images,if I try to upload 2 per each it's working but if I try 6 and 7 it's not proceeeding anymore.

Selecting photos from a Shared Album results in 'null'

On iOS, when you select a not recently openend picture from a shared album, the getPictures() command returns null.

This can be demonstrated on iOS 8.2 with the following sample code:

window.imagePicker.getPictures(
    function (results) {
        for (var i = 0; i < results.length; i++) {
            console.log('Image URI: ' + results[i]);
        }
    }, function (error) {
        // note: in cases of a shared library this results simply in 'null'
        console.log('Error: ' + error);
    }
);

I have tested this in the case when having the Optimize Storage feature disabled. It seems that older pictures in a shared album, or pictures originating from another author (like a family member), are quite suitable to reproduce this bug. But this does not occur for all photos in a shared album.

Q: is it intentional that images smaller than the requested width/height get scaled up? (iOS)

The doc states the width and height parameter specify the "MAX width and height" of the output image:

    // max width and height to allow the images to be.  Will keep aspect
    // ratio no matter what.  So if both are 800, the returned image
    // will be at most 800 pixels wide and 800 pixels tall.  If the width is
    // 800 and height 0 the image will be 800 pixels wide if the source
    // is at least that wide.
    width: int,
    height: int,

However, the implementation (iOS) actually scales up (upscales) images smaller than the specified width and height.

What is the intention for the width and height parameters? Are they:

  • the exact width and height, aspect ratio maintained. I.E. Always scale if width or height is specified. Scale such that at least one of output image's width or height exactly matches the requested width or height while the other is <= the requested value such that the input width/height == the output width/height. This is the current (iOS) implementation.
  • OR are they intended to be the maximum width and height, aspect ratio maintained. I.E. If the source width/height exceeds the requested width/height, then scale as above, otherwise do nothing. This is what I think the current documentation means.

For my purposes, I want the latter. If the image is smaller than the specified width/height, I don't want it to be scaled. If this is the intended semantics, I have a pull-request ready with the fix for iOS.

App becoming non-responsive

Hi

As soon as I grab the scroller and drag it down to get to old-ish photos, or do a big swipe, or even just scroll about 30 rows down in the gallery, the app freezes/crashes.

Is anyone else experiencing the app becoming totally unresponsive when scrolling far down the image gallery? Is the plugin trying to load hundreds of photos at once, not just the ones ending up in the viewport / is it not releasing the photos I've scrolled past? I'm happy to dig into the code and see what I can do to help fix, but wanted to see if anyone else has experienced this first...

(Plugin v1.0.4. Gallery has somewhere between 500 and 1000 photos. Samsung Galaxy S3, Android 4.3)

Thanks

Display selected images and get imageURI

How can I display selected images and get imageURI of same in other function?

function getMultiplePhoto() {
          window.imagePicker.getPictures(
                function(results) {

                for (var i = 0; i < results.length; i++) {                          
                    var parent = document.getElementById('images');                             
                    img = new Image();
                    img.style.display = 'block';
                    img.className = 'hi';
                    img.src = results[i];
                    parent.appendChild(img);                
                }
            }, function (error) {
                console.log('Error: ' + error);
            }, {
                maximumImagesCount: 10,
                width: 800

            }
        );
    }

unnecessary compression

It would be great if the plugin returns the source image location from gallery without compressing or moving it when I set the width and quality higher than or equal to the source image (i.e. width 100000 and the quality 100)

Entry has private access in LinkedHashMap

Thanks for the plugin. If I can fix this problem that I am encountering, this is gona be pretty useful to me. The error that I get is

src/com/synconset/ImageFetcher.java:[293,57] error: Entry has private access in LinkedHashMap

I am a newbie to java and I tried replacing

// Hard cache, with a fixed maximum capacity and a life duration private final HashMap Integer, Bitmap sHardBitmapCache = new LinkedHashMap Integer, Bitmap(

with

// Hard cache, with a fixed maximum capacity and a life duration private final Map Integer, Bitmap sHardBitmapCache = new LinkedHashMap Integer, Bitmap(

AND

@Override protected boolean removeEldestEntry(LinkedHashMap.Entry eldest) { if (size() > HARD_CACHE_CAPACITY) { // Entries push-out of hard reference cache are transferred to // soft reference cache

with

@Override protected boolean removeEldestEntry(Map.Entry eldest) { if (size() > HARD_CACHE_CAPACITY) { // Entries push-out of hard reference cache are transferred to // soft reference cache

In short I replaced "LinkedHashMap" with "Map"

But when I do that I get the following error:

/Cloudlocater/src/com/synconset/ImageFetcher.java:[290,18] error: cannot find symbol
class ImageFetcher
/Cloudlocater/src/com/synconset/ImageFetcher.java:[293,47] error: package Map does not exi

Any clue on how I could fix this?

Thanks once again,
M&M

OutOfMemoryError while listing images

Hi, first I want thank you for this plugin ;)

I tested a bit around an I get an OutOfMemoryError while scrolling down the images.

E/dalvikvm-heap(29810): Out of memory on a 786448-byte allocation.
I/dalvikvm(29810): "pool-4-thread-37" prio=5 tid=69 RUNNABLE
I/dalvikvm(29810):   | group="main" sCount=0 dsCount=0 obj=0x4125a888 self=0xcefa20
I/dalvikvm(29810):   | sysTid=31179 nice=10 sched=0/0 cgrp=bg_non_interactive handle=11284608
I/dalvikvm(29810):   | schedstat=( 0 0 0 ) utm=5 stm=2 core=0
I/dalvikvm(29810):   at android.graphics.BitmapFactory.nativeDecodeFileDescriptor(Native Method)
I/dalvikvm(29810):   at android.graphics.BitmapFactory.decodeFileDescriptor(BitmapFactory.java:575)
I/dalvikvm(29810):   at android.provider.MediaStore$InternalThumbnails.getMiniThumbFromFile(MediaStore.java:458)
I/dalvikvm(29810):   at android.provider.MediaStore$InternalThumbnails.getThumbnail(MediaStore.java:540)
I/dalvikvm(29810):   at android.provider.MediaStore$Images$Thumbnails.getThumbnail(MediaStore.java:980)
I/dalvikvm(29810):   at com.synconset.ImageFetcher$BitmapFetcherTask.doInBackground(ImageFetcher.java:185)
I/dalvikvm(29810):   at com.synconset.ImageFetcher$BitmapFetcherTask.doInBackground(ImageFetcher.java:164)
I/dalvikvm(29810):   at android.os.AsyncTask$2.call(AsyncTask.java:264)
I/dalvikvm(29810):   at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
I/dalvikvm(29810):   at java.util.concurrent.FutureTask.run(FutureTask.java:137)
I/dalvikvm(29810):   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
I/dalvikvm(29810):   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
I/dalvikvm(29810):   at java.lang.Thread.run(Thread.java:856)
.....
E/MediaStore(29810): failed to allocate memory for thumbnail content://media/external/images/thumbnails/27; java.lang.OutOfMemoryError
V/MediaStore(29810): filePath = /mnt/sdcard/DCIM/Camera/1409294487034.jpg
...
E/dalvikvm-heap(29810): Out of memory on a 786448-byte allocation.
I/dalvikvm(29810): "pool-4-thread-38" prio=5 tid=70 RUNNABLE
I/dalvikvm(29810):   | group="main" sCount=0 dsCount=0 obj=0x411f0f20 self=0xac4000
I/dalvikvm(29810):   | sysTid=31180 nice=10 sched=0/0 cgrp=bg_non_interactive handle=10572256
I/dalvikvm(29810):   | schedstat=( 0 0 0 ) utm=9 stm=0 core=0
I/dalvikvm(29810):   at android.graphics.Bitmap.nativeCreate(Native Method)
I/dalvikvm(29810):   at android.graphics.Bitmap.createBitmap(Bitmap.java:605)
I/dalvikvm(29810):   at android.graphics.Bitmap.createBitmap(Bitmap.java:551)
I/dalvikvm(29810):   at com.synconset.ImageFetcher$BitmapFetcherTask.doInBackground(ImageFetcher.java:199)
I/dalvikvm(29810):   at com.synconset.ImageFetcher$BitmapFetcherTask.doInBackground(ImageFetcher.java:164)
I/dalvikvm(29810):   at android.os.AsyncTask$2.call(AsyncTask.java:264)
I/dalvikvm(29810):   at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
I/dalvikvm(29810):   at java.util.concurrent.FutureTask.run(FutureTask.java:137)
I/dalvikvm(29810):   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
I/dalvikvm(29810):   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
I/dalvikvm(29810):   at java.lang.Thread.run(Thread.java:856)
I/dalvikvm(29810): 

Do you have an idea how to fix this?

App crash on Android

After selecting photos and clicking the button Ok, It will crash if I have more than 6 images, each image have 3Mb size, or it will crash if after I pick 3 image, upload it and pick 3 images again.

Is someone experiencing the same error and knows a way to solve it ?

here is the log
06-04 13:56:04.029: E/dalvikvm-heap(5390): Out of memory on a 50331664-byte allocation.
06-04 13:56:04.076: E/dalvikvm-heap(5390): Out of memory on a 50331664-byte allocation.
06-04 13:56:04.089: E/AndroidRuntime(5390): FATAL EXCEPTION: AsyncTask #4
06-04 13:56:04.089: E/AndroidRuntime(5390): java.lang.RuntimeException: An error occured while executing doInBackground()
06-04 13:56:04.089: E/AndroidRuntime(5390): at android.os.AsyncTask$3.done(AsyncTask.java:299)
06-04 13:56:04.089: E/AndroidRuntime(5390): at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:352)
06-04 13:56:04.089: E/AndroidRuntime(5390): at java.util.concurrent.FutureTask.setException(FutureTask.java:219)
06-04 13:56:04.089: E/AndroidRuntime(5390): at java.util.concurrent.FutureTask.run(FutureTask.java:239)
06-04 13:56:04.089: E/AndroidRuntime(5390): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
06-04 13:56:04.089: E/AndroidRuntime(5390): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
06-04 13:56:04.089: E/AndroidRuntime(5390): at java.lang.Thread.run(Thread.java:838)
06-04 13:56:04.089: E/AndroidRuntime(5390): Caused by: java.lang.OutOfMemoryError
06-04 13:56:04.089: E/AndroidRuntime(5390): at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)
06-04 13:56:04.089: E/AndroidRuntime(5390): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:548)
06-04 13:56:04.089: E/AndroidRuntime(5390): at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:321)
06-04 13:56:04.089: E/AndroidRuntime(5390): at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:347)
06-04 13:56:04.089: E/AndroidRuntime(5390): at com.synconset.MultiImageChooserActivity$ResizeImagesTask.getBitmap(MultiImageChooserActivity.java:595)
06-04 13:56:04.089: E/AndroidRuntime(5390): at com.synconset.MultiImageChooserActivity$ResizeImagesTask.doInBackground(MultiImageChooserActivity.java:489)
06-04 13:56:04.089: E/AndroidRuntime(5390): at com.synconset.MultiImageChooserActivity$ResizeImagesTask.doInBackground(MultiImageChooserActivity.java:480)
06-04 13:56:04.089: E/AndroidRuntime(5390): at android.os.AsyncTask$2.call(AsyncTask.java:287)
06-04 13:56:04.089: E/AndroidRuntime(5390): at java.util.concurrent.FutureTask.run(FutureTask.java:234)
06-04 13:56:04.089: E/AndroidRuntime(5390): ... 3 more
06-04 13:56:04.567: E/WindowManager(5390): Activity com.synconset.MultiImageChooserActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView{417956f8 V.E..... R......D 0,0-513,243} that was originally added here
06-04 13:56:04.567: E/WindowManager(5390): android.view.WindowLeaked: Activity com.synconset.MultiImageChooserActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView{417956f8 V.E..... R......D 0,0-513,243} that was originally added here

Thanks...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.