coomar2841 / image-chooser-library

An Easy Image/Video Chooser Library for your Android Apps
646 stars 192 forks source link

Bichooser folder bloats with saved images #183

Open jessexx opened 8 years ago

jessexx commented 8 years ago

After taking a picture, a single copy is stored in the /storage/0/emulated/0/bichooser folder. After selecting an image from the gallery, three copies are created with varying image sizes. Is this intended, and if so, is there a way to clear the folder? clearOldFiles() also does not seem to work.

The new android-multipicker-library also has this behavior, it just saves the images into /storage/0/emulated/0/{appname}/{appname}Pictures instead.

coomar2841 commented 8 years ago

This is intended. clearOldFiles should work when you reach a specific threshold foder size.

jessexx commented 8 years ago

Is there a var somewhere I can set so that only TAKE_IMAGE_REQUEST images are saved while CHOOSE_IMAGE_REQUEST images are not? What happens is that on some phones, the gallery app detects the bichooser folder and you end up viewing a ton of duplicate images.

coomar2841 commented 8 years ago

It's not there. I can add this as a new feature.

nilsorathiya commented 7 years ago

@coomar2841 just use ".bichooser" instead of "bichooser" now for hiding from gallery or albums in device, when you creating folder inside library.

hardikJoshi123 commented 7 years ago

Hey! anybody solved this issue? I have same issue in my case.

Transformat commented 7 years ago

You can use this code to delete all the files

static public boolean deleteDirectory(File path) { if( path.exists() ) { File[] files = path.listFiles(); if (files == null) { return true; } for(int i=0; i<files.length; i++) { if(files[i].isDirectory()) { deleteDirectory(files[i]); } else { files[i].delete(); } } } return( path.delete() ); }

and call this like this :

deleteDirectory(new File(android.os.Environment.getExternalStorageDirectory()+"/bichooser"));

Make sure you have the write permissions. That's it. Hope this helps.

nilsorathiya commented 7 years ago

But I have one easy solution that if we replace bichooser to .bichooser, that will also prevent all choosen photos in Gallery

Transformat commented 7 years ago

Yes this will indeed do the job but it will still fill up space in the phone. Which is not a good practice.