Git Product home page Git Product logo

image-chooser-library's People

Contributors

abdyer avatar brracula avatar coomar2841 avatar dalinaum avatar dmitry-kopitkov avatar hipercube avatar juandiana avatar tha022 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

image-chooser-library's Issues

Renaming downloaded image

Actually its not issue , its a question, I want to rename the photo when set to image, howit is possible.
And thanks for such a great library..

Image compression

Is there a way to compress images to say a small, medium and large size using this library?

If not, is there a specific place this can be implemented? (I will send a pull request if there is).

Picking image from onedrive fails

I have the onedrive android app installed and onedrive shows as a source on the new kitkat document picker. It shows in the bottom section along with gallery and photos. When I select a jpeg image, image chooser fails with "file not found" as the reason.

Here is the log

04-07 14:51:06.766: W/System.err(6096): java.io.FileNotFoundException: /Dos Figuras.jpeg: open failed: ENOENT (No such file or directory)
04-07 14:51:06.766: W/System.err(6096): at libcore.io.IoBridge.open(IoBridge.java:409)
04-07 14:51:06.766: W/System.err(6096): at java.io.FileInputStream.(FileInputStream.java:78)
04-07 14:51:06.766: W/System.err(6096): at com.kbeanie.imagechooser.threads.MediaProcessorThread.copyFileToDir(MediaProcessorThread.java:209)
04-07 14:51:06.766: W/System.err(6096): at com.kbeanie.imagechooser.threads.MediaProcessorThread.process(MediaProcessorThread.java:95)
04-07 14:51:06.766: W/System.err(6096): at com.kbeanie.imagechooser.threads.ImageProcessorThread.process(ImageProcessorThread.java:97)
04-07 14:51:06.766: W/System.err(6096): at com.kbeanie.imagechooser.threads.ImageProcessorThread.processImage(ImageProcessorThread.java:91)
04-07 14:51:06.766: W/System.err(6096): at com.kbeanie.imagechooser.threads.ImageProcessorThread.run(ImageProcessorThread.java:55)
04-07 14:51:06.766: W/System.err(6096): Caused by: libcore.io.ErrnoException: open failed: ENOENT (No such file or directory)
04-07 14:51:06.766: W/System.err(6096): at libcore.io.Posix.open(Native Method)
04-07 14:51:06.766: W/System.err(6096): at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
04-07 14:51:06.766: W/System.err(6096): at libcore.io.IoBridge.open(IoBridge.java:393)
04-07 14:51:06.776: W/System.err(6096): ... 6 more
04-07 14:51:06.776: W/System.err(6096): java.lang.Exception: File not found
04-07 14:51:06.776: W/System.err(6096): at com.kbeanie.imagechooser.threads.MediaProcessorThread.copyFileToDir(MediaProcessorThread.java:222)
04-07 14:51:06.776: W/System.err(6096): at com.kbeanie.imagechooser.threads.MediaProcessorThread.process(MediaProcessorThread.java:95)
04-07 14:51:06.776: W/System.err(6096): at com.kbeanie.imagechooser.threads.ImageProcessorThread.process(ImageProcessorThread.java:97)
04-07 14:51:06.776: W/System.err(6096): at com.kbeanie.imagechooser.threads.ImageProcessorThread.processImage(ImageProcessorThread.java:91)
04-07 14:51:06.776: W/System.err(6096): at com.kbeanie.imagechooser.threads.ImageProcessorThread.run(ImageProcessorThread.java:55)

Gradle artifact

Is there a plan on publishing the version artifacts to a maven repository for a nicer gradle integration?

Bug from video recording, Android 4.1 Galaxy S3 Mini

Hello again,

I have detected another bug trying use image-chooser-library from one GalaxyS3 Mini with Android 4.1, it dont show ok and cancel buttons.

Have you detected any same it?

Regards and very thanks for your work.

Document browser has two entry points for Onedrive and one of them fails

Not quite sure the best way to describe this. The kitkat+ document browser navigation drawer has upper and lower sections. For me on lollipop the upper section has document providers like Images, Downloads, Recent, Internal storage, Drive and OneDrive. The lower section has Photos, OneDrive plus others.

When I use OneDrive from the upper section, I get a fail in the image chooser library with error toast "file not found". Here is the uri:
content://com.microsoft.skydrive.content.StorageAccessProvider/document/content%3A%2F%2Fcom.microsoft.skydrive.content.metadata%2Fproperty%2Fjay%2540ariseditions.com%2FD5796D89F69EDE94!59186%2FSnow%25202012%2520008.JPG

When I use OneDrive from the lower section, the operation succeeds. Here is the uri:
file:///storage/emulated/0/Android/data/com.microsoft.skydrive/cache/SkyDriveCacheFile_2304.cachedata/Snow%202012%20008.JPG

Please update build.gradle dependencies

Should be:

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:appcompat-v7:21.+'
    compile project(':image-chooser-library')
    compile 'com.google.android.gms:play-services:6.+'
}

Please add multi-choice

Choosing multiple images / videos / files at once is fundamental, because if user is allowd e.g. to upload multiple images, it's the worst UX if it has to add each manually.

Could you please add multi-choice? Can anybody in meantime suggest how to achieve that with this lib?

Rotate images

Hi,

In Galaxy S4, for example, the image appears rotate -90ΒΊ. I think you should control about rotations, because some devices returns rotated images.

Congrats!

Passing extras

Is there a way to pass for instance intent.putExtra("android.intent.extra.durationLimit", 3);?

Device XT885 4.1.2 Out of Memory

View Crash Report on Crittercism

Reported by: Kumar Bibek ([email protected])

Status: Unresolved

This Crash occured 1 times for 1 users

0 java.lang.OutOfMemoryError
1 at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)
2 at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:564)
3 at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:301)
4 at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:326)
5 at com.kbeanie.imagechooser.threads.MediaProcessorThread.compressAndSaveImage(MediaProcessorThread.java:210)
6 at com.kbeanie.imagechooser.threads.MediaProcessorThread.getExactThumnailPath(MediaProcessorThread.java:121)
7 at com.kbeanie.imagechooser.threads.MediaProcessorThread.createThumbnails(MediaProcessorThread.java:101)
8 at com.kbeanie.imagechooser.threads.ImageProcessorThread.process(ImageProcessorThread.java:94)
9 at com.kbeanie.imagechooser.threads.ImageProcessorThread.processImage(ImageProcessorThread.java:86)
10 at com.kbeanie.imagechooser.threads.ImageProcessorThread.run(ImageProcessorThread.java:55)

Image file name containing encoded url can cause an issue

If you have an image which contains an encoded URL as the file name then the image-chooser-library will return "File not found". It appears that Uri.parse decodes the file name which causes an issue when trying to copy the file in the MediaProcessThread copyFileToDir() method.

What would the downside be to changing
file = new File(Uri.parse(filePath).getPath());
to
file = new File(filePath);

Others Folders Images Problem

I was working with this library, When I choose images from other folder like CameraSample Photos, so the Toast Appeared that file not found.
screenshot_2014-05-12-14-58-10

Maven repository

Then i try to import library from maven, i retrieve
Error:Module version com.kbeanie:image-chooser-library:1.3.5 depends on libraries but is not a library itself

Thanks.

Choosing Image from Google Drive app fails

Hi,

I'm using your demo app, I'm choosing image -> complete action using google drive app -> choose some image there.
I see message "couldn't process null file".

please add support for this case.

Thanks,
Dmitry

Save image in app folder

Hello, your library is very nice. There is a issue when I would like to save image to app folder. I change method getDirectory in FileUtils like this
public static String getDirectory(Context context, String foldername) {
File storageDir = null;
if (Environment.MEDIA_MOUNTED.equals(Environment
.getExternalStorageState())) {
storageDir = context
.getExternalFilesDir(Environment.DIRECTORY_PICTURES);
if (storageDir != null) {
if (!storageDir.mkdirs()) {
if (!storageDir.exists()) {
Log.e("Pictures", "failed to create directory");
return null;
}
}
}
} else {
Log.v(context.getString(R.string.app_name),
"External storage is not mounted READ/WRITE.");
}
return storageDir.getAbsolutePath();
}
It is not working. Can you help me ?

imagechooser null pointer onActivityResult

Hi,

I would like to notify a problem I've found using imagechooser library.

After opening the gallery and going back to the main activity, android sometimes has killed the activity, so I get null pointer exception into "onActivityResult" because imageChooserManager=null.

@OverRide
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (resultCode == RESULT_OK &&
(requestCode == ChooserType.REQUEST_PICK_PICTURE ||
requestCode == ChooserType.REQUEST_CAPTURE_PICTURE)) {
imageChooserManager.submit(requestCode, data);
}
}

Could you explain how to solve this problem into the section "usage:"? It happens because all is controlled inside de object ImageChooserManager, how could I restore this object if the activity is killed?

Thanks.

Permission Denial: opening provider com.android.gallery3d.provider.GalleryProvider

2013-08-22 12 10 32

Caused by: java.lang.SecurityException: Permission Denial: opening provider com.android.gallery3d.provider.GalleryProvider from ProcessRecord{411c6770 20120:com.beanie.imagechooserapp/u0a10161} (pid=20120, uid=10161) requires com.google.android.gallery3d.permission.GALLERY_PROVIDER or com.google.android.gallery3d.permission.GALLERY_PROVIDER
at android.os.Parcel.readException(Parcel.java:1425)
at android.os.Parcel.readException(Parcel.java:1379)
at android.app.ActivityManagerProxy.getContentProvider(ActivityManagerNative.java:2545)
at android.app.ActivityThread.acquireProvider(ActivityThread.java:4648)
at android.app.ContextImpl$ApplicationContentResolver.acquireUnstableProvider(ContextImpl.java:2054)
at android.content.ContentResolver.acquireUnstableProvider(ContentResolver.java:1101)
at android.content.ContentResolver.query(ContentResolver.java:356)
at android.content.ContentResolver.query(ContentResolver.java:315)
at com.beanie.imagechooser.api.BChooser.getAbsoluteImagePathFromUri(BChooser.java:112)
at com.beanie.imagechooser.api.ImageChooserManager.processImageUri(ImageChooserManager.java:216)
at com.beanie.imagechooser.api.ImageChooserManager.processImageFromGallery(ImageChooserManager.java:252)
at com.beanie.imagechooser.api.ImageChooserManager.submit(ImageChooserManager.java:198)
at com.beanie.imagechooserapp.ImageChooserActivity.onActivityResult(ImageChooserActivity.java:120)
at android.app.Activity.dispatchActivityResult(Activity.java:5293)
at android.app.ActivityThread.deliverResults(ActivityThread.java:3443)
... 11 more

Picking image fails using external storage on Lollipop

This may not be limited to lollipop. The image is stored on the device in Pictures/Instragram. Using the "Images" provider succeeds and this is the returned uri:
content://com.android.providers.media.documents/document/image%3A13194

Using the "Internal storage" provider to pick the same image fails with error toast "Couldn't process a null file". Here is the returned uri:
content://com.android.externalstorage.documents/document/primary%3APictures%2FInstagram%2FIMG_20141104_183552.jpg

How can get selected video size?

Hi there, I want to make a limitation to my users to can only select video files up to 10 MB size.
How can get video size?
thanks

Option to not generate thumbnails

Thumbnails are not always needed, and their generation takes time and processing power. An option to disable thumbnail generation would be really helpful

why should i have internet connection permissions?

I'm using image-chooser-library, but i was getting 'file not found' error in some cases with different files, although other files was working correctly.

The error is solved when i added Internet permissions to the app and switched on mobile date of the device.

I want to know why such library would need internet connection for?

New chooser type needed

Hi,

I need this kind of chooser:
ChooserType.REQUEST_PICK_IMAGE_OR_VIDEO
To make it possible for user to go to gallery and choose image or video (whatever he wants). Maybe better to call it ChooserType.REQUEST_PICK_MEDIA..

Can you add it? Is it lots of work? Maybe I can add this functionality by myself..

Thanks,
Dmitry

wrong requestCode when instantiating the manager with a fragment

I found out that the requestCode received by onActivityResult does NOT match the requestCode specified in the manager constructor, if the manager is instantiated using ImageChooserManager(Fragment fragment, int type). Everything works fine in case of using an activity.

The codes received by onActivityResult are 65827 for ChooserType.REQUEST_PICK_PICTURE and 65830 for ChooserType.REQUEST_CAPTURE_PICTURE.

Samsung Galaxy S4 ENOENT (No such file or directory)

I/ImageChooserManager(27319): File: content://media/external/images/media/53529
I/MediaProcessorThread(27319): Directory size: 8529038
I/MediaProcessorThread(27319): Deleted 0 files
I/ImageProcessorThread(27319): Processing Image File: content://media/external/images/media/53529
I/MediaProcessorThread(27319): Image Uri: content://media/external/images/media/53529
D/AbsListView(27319): unregisterIRListener() is called
I/MediaProcessorThread(27319): Before: 0x0
I/MediaProcessorThread(27319): Scale: 0
I/MediaProcessorThread(27319): Rotate: 0
I/MediaProcessorThread(27319): After: 1050x1152
I/MediaProcessorThread(27319): Compressing ... THUMBNAIL SMALL
I/MediaProcessorThread(27319): Before: 0x0
I/MediaProcessorThread(27319): Scale: 0
I/MediaProcessorThread(27319): Rotate: 0
I/MediaProcessorThread(27319): After: 525x576
I/ImageChooserManager(27319): File: content://media/external/images/media/54786
I/MediaProcessorThread(27319): Directory size: 10379373
I/MediaProcessorThread(27319): Deleted 0 files
I/ImageProcessorThread(27319): Processing Image File: content://media/external/images/media/54786
I/MediaProcessorThread(27319): Image Uri: content://media/external/images/media/54786
V/GAV4 (27319): Thread[GAThread,5,main]: putHit called
I/MediaProcessorThread(27319): Compressing ... THUMBNAIL
E/JHEAD (27319): can't open '/storage/emulated/0/myfolder/20150214_151157_fact_2.jpg'
I/MediaProcessorThread(27319): Before: 0x0
I/MediaProcessorThread(27319): Scale: 0
I/MediaProcessorThread(27319): Rotate: 0
E/BitmapFactory(27319): Unable to decode stream: java.io.FileNotFoundException: /storage/emulated/0/myfolder/20150214_151157_fact_2.jpg: open failed: ENOENT (No such file or directory)
W/System.err(27319): java.lang.NullPointerException
W/System.err(27319): at com.kbeanie.imagechooser.threads.MediaProcessorThread.compressAndSaveImage(MediaProcessorThread.java:183)
W/System.err(27319): at com.kbeanie.imagechooser.threads.MediaProcessorThread.getThumnailPath(MediaProcessorThread.java:116)
W/System.err(27319): at com.kbeanie.imagechooser.threads.MediaProcessorThread.createThumbnails(MediaProcessorThread.java:107)
W/System.err(27319): at com.kbeanie.imagechooser.threads.ImageProcessorThread.process(ImageProcessorThread.java:108)
W/System.err(27319): at com.kbeanie.imagechooser.threads.ImageProcessorThread.processImage(ImageProcessorThread.java:100)
W/System.err(27319): at com.kbeanie.imagechooser.threads.ImageProcessorThread.run(ImageProcessorThread.java:57)
W/System.err(27319): java.lang.Exception: Corrupt or deleted file???
W/System.err(27319): at com.kbeanie.imagechooser.threads.MediaProcessorThread.compressAndSaveImage(MediaProcessorThread.java:205)
W/System.err(27319): at com.kbeanie.imagechooser.threads.MediaProcessorThread.getThumnailPath(MediaProcessorThread.java:116)
W/System.err(27319): at com.kbeanie.imagechooser.threads.MediaProcessorThread.createThumbnails(MediaProcessorThread.java:107)
W/System.err(27319): at com.kbeanie.imagechooser.threads.ImageProcessorThread.process(ImageProcessorThread.java:108)
W/System.err(27319): at com.kbeanie.imagechooser.threads.ImageProcessorThread.processImage(ImageProcessorThread.java:100)
W/System.err(27319): at com.kbeanie.imagechooser.threads.ImageProcessorThread.run(ImageProcessorThread.java:57)

Get video from google+

In Nexus10, Android 4.3, when i select video from gallery it show videos from google+, and it fail if i try select one

Imports of com.kbeanie.imagechooser.R should be removed

ImageChooseBuilder & VideoChooserBuilder both import com.kbeanie.imagechooser.R to access strings. It makes it impossible to use these files in another project without modifying them.

You could instead use properties, with hardcoded default values, which can be overridden.

Add to Maven Central?

I like this library, i think that it is good.

You could add it to Maven Central for integrate it?

I am, too, writing library about upload any Multipart/POST content to server. I think that i could use your library, replacing my own library, and, if you upload to Maven Central and add support for Maven, it will be more easy.

It is my library: https://github.com/sopinet/android-mediauploader

I can help you for add Maven support too.

Thanks, regards!

Images bimagechooser

when saving the photo or image from gallery, the pictures stored on previous days seem to get deleted from the bimagechooser folder...

Issue with Mi3 camera

I used your library in my app. It works like charm in all devices but Mi3.

Here is the stack trace:
java.lang.RuntimeException: Unable to resume activity {com.mypackage/com.mypackage.MyActivity}: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=294, result=-1, data=null} to activity {com.mypackage/com.mypackage.MyActivity}: java.lang.NullPointerException at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2777) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2806) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2241) at android.app.ActivityThread.access$800(ActivityThread.java:138) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1199) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5034) 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:805) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:621) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=294, result=-1, data=null} to activity {com.mypackage/com.mypackage.MyActivity}: java.lang.NullPointerException at android.app.ActivityThread.deliverResults(ActivityThread.java:3354) at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2764) ... 12 more Caused by: java.lang.NullPointerException at com.mypackage/com.mypackage.MyActivity.onActivityResult(MyActivity.java:4194) at android.app.Activity.dispatchActivityResult(Activity.java:5438) at android.app.ActivityThread.deliverResults(ActivityThread.java:3350)

Get extra's from ChooserManager

Hello,

Thanks to #34 it's possible to set extra's on ChooserManager's but I can't find a way to retrieve these afterwards, is this currently possible or would it require a new getter to fetch these?

Thanks

Lollipop API 21: ImageChooserListener callback functions are not called?

I have used the library previously and It works like a charm.

Currently my application has targetSdkVersion 21 and testing application on Nexus 4 / 5.0.1 (API 21). I am calling pick photo from within a fragment like following

imageChooserManager = new ImageChooserManager(this, ChooserType.REQUEST_PICK_PICTURE);
imageChooserManager.setImageChooserListener(this);
imageChooserManager.choose();

after picking photo, I do get in onActivityResult and imageChooserManager.submit(requestCode, data) is called but I never get any error in log or callback to onImageChosen or onError.
I have checked the content of data and I get correct URI of image from data.getData().toString().

After it didn't work, I tested the same application on Nexus 7/4.4/API 19 and It worked there.
I see library is complied with targetSdkVersion 20. Are there any known issues with library working on API 21?

Out Of Memory Error: HTC Nexus One

View Crash Report on Crittercism

Reported by: Kumar Bibek ([email protected])

Status: Unresolved

This Crash occured 1 times for 1 users

0 java.lang.OutOfMemoryError: bitmap size exceeds VM budget
1 at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)
2 at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:470)
3 at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:284)
4 at com.kbeanie.imagechooser.threads.MediaProcessorThread.compressAndSaveImage(MediaProcessorThread.java:158)
5 at com.kbeanie.imagechooser.threads.MediaProcessorThread.getThumbnailSmallPath(MediaProcessorThread.java:112)
6 at com.kbeanie.imagechooser.threads.MediaProcessorThread.createThumbnails(MediaProcessorThread.java:97)
7 at com.kbeanie.imagechooser.threads.ImageProcessorThread.process(ImageProcessorThread.java:93)
8 at com.kbeanie.imagechooser.threads.ImageProcessorThread.processImage(ImageProcessorThread.java:85)
9 at com.kbeanie.imagechooser.threads.ImageProcessorThread.run(ImageProcessorThread.java:54)

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.