Comments (8)
@ArthurHub You were right! I couldn't reproduce the issue using your way of selecting files, thank you so much!
from android-image-cropper.
Looks like it has something to do with KitKat documents provider, there are a few relevant question on SO: example1, example2, example3.
Is it 100% reproducible?
Do you experience it on KitKat?
Did you use the "Documents" source for getting image for cropping?
What was the source of the image within the "Documents" UI? (Recent/Drive/Downloads/Gallery/etc.)
from android-image-cropper.
@ArthurHub I'm on android 6.0.1, And yes for some images it's 100% reproducible, The source of images was Recents, and i'm using com.mlsdev.rximagepicker:library as image picker library, I'm wondering that there's no problem before cropping the image and CropImageView loads the URI properly but just after pressing crop it throws that exception!
from android-image-cropper.
100% reproducible is excellent, we can make sure we found a solution then.
I think this library is missing a "persistable" permissions request (relevant doc):
getContentResolver().takePersistableUriPermission(uri, Intent.FLAG_GRANT_READ_URI_PERMISSION);
can you try adding it before setting it for cropping.
from android-image-cropper.
@ArthurHub Sure! let me give it a try! thanks
from android-image-cropper.
@ArthurHub It didn't help added another exception:
No persistable permission grants found for UID 10240 and Uri 0 @ content://com.android.providers.media.documents/document/image:74085
from android-image-cropper.
Looks like there are a few things missing in the image pick intent creation, this SO questions cover this problem exactly.
looking at rximagepicker it doesn't use the "proper" intent for KitKat and above API (source)
It should be more like this one:
Intent intent;
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT){
intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
intent.addFlags(Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION);
}else{
intent = new Intent(Intent.ACTION_GET_CONTENT);
}
intent.putExtra(Intent.EXTRA_LOCAL_ONLY, true);
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
intent.setType("image/*");
startActivityForResult(Intent.createChooser(intent, getResources().getString(R.string.form_pick_photos)), REQUEST_PICK_PHOTO);
Try using your own code to pick the image from the library and see if it works
P.S. a quick look at rximagepicker didn't impress me, there may be better libraries or just write a simple picker like I use in this library sample (source).
from android-image-cropper.
@ArthurHub Thanks,i'll try your solution to pickup images and let you know the results!
from android-image-cropper.
Related Issues (20)
- error in manifest about CropImageActivity HOT 1
- Native crash in "libc.so tgkill" at SupportRequestManagerFragment HOT 1
- activity is not found in project or libraies AndroidManifest.xml HOT 1
- The camera not working above android version 11.. HOT 5
- Start Activity with request code HOT 1
- RLÒP?PPÒÌUIUYYYTTTTTRRRÀ¹³⁴¹1L2J⁴⁶⁶⁷⁸⁹⁰=/ HOT 1
- The bottom of the cropped image is not fully displayed HOT 1
- Class referenced in the manifest was not found in the project or the libraries HOT 2
- The dependencies are not found in android 12 HOT 1
- Camera Issues (Android 11 and 12) HOT 6
- Cropped picture clarity is so poor HOT 3
- Could not find com.hendraanggrian.appcompat:socialview:0.3. Required by: project :app Search in build.gradle files HOT 2
- pick from google drive HOT 1
- Not showing any other options but opening camera only HOT 1
- i cant use the crop image !! HOT 1
- Unable to use images from camera HOT 3
- Error while importing HOT 6
- Veracode - vulnerabilities
- i can't build HOT 1
- cant use preview camera view on this cropper
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-image-cropper.