-
-
Notifications
You must be signed in to change notification settings - Fork 269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] - Unable to Crop image from Uri #114
Comments
Hey @felipecs81 thanks for raising this. This maybe be some issue with the URI path. Could you log your URI? If this is the case, we maybe need to do some changes how we consume de URI. Another thing that can help, if you can reproduce on the library samples we have here will be very easier to debug for me hahahah |
Hey @Canato Thank you for you quick reply. This is the URI which I am passing to the cropper: This URI is created using the method: Uri.parse(args.filePath) Due to the architecture, I can only access the URI through the path. |
@felipecs81 do you have the This look like a path issue, because of Android 11. Can you try on Android 9? So we can be sure. If this is the case, is something in your URI, if not we keep digging. But for sure we need a more clear error message when this happens. Keep me on loop please |
Hi,
|
Hi, Equipment environment:Google Pixel 4 Android 11 Uri uri = result.getUri(); uri.getPath(): /my_images/Pictures/cropped6350359284020855240.jpg i tried url convert file method by link that could work. correct file path: /data/user/0/com.package/cache/1619505580451.jpg |
Hey @Taogo-Hugo this behaviour is correctly. |
The Uri is correct here.
This is not the correct file path because of the Android 10 and 11 storage scope changes based on external permission. If after using the latest version you still find issues, please open a PR with a reproducible sample code so I can debug =) |
Hi Canato,
|
indeed @Taogo-Hugo if you want to keep this file you need to copy and save. This is done so the library would not take too much cache space. If you feel that you need different files for each image we can do \o/! If you really need, maybe I can do it for next week |
Hi @Canato, I think this is enough, thank! I try to use like the Glide library, want to load file path from
|
@Taogo-Hugo interesting hahahah, we need to finish one loading before bring the next one. Will add later the change |
Hi @Canato, Ok, thanks. |
Removing the |
I just wanted to know weather the issue is solved or not. If not please let me know I will look into it. |
@ashique-perumbavoor thanks for the interest, I'm not sure if was solved or not, cause no one answer me anymore Basically this is related to the URI path, now in the library we have two methods to get the URI, one return Until now no one raise new issues about this, but since I could never reproduce the error my self I'm not sure if is really fixed. Ideally someone who can reproduce could provide a sample with the error or fix it. Please feel free to dig a little see if you can reproduce and drop a PR =D |
@Canato Okay I think I can reproduce it because I had the issue in the past. I will look into it after a few days😊 |
Let's keep this mess organised! This issue has been automatically marked as |
Describe the bug
First of all I would like to thank everyone involved in this library for the great work you have done. Well done.
I am currently using this library in a project where I have a personalized interface where the user can take a photo. When he takes the picture I take this uri and send it to another screen to edit the image.
On this screen I have a button to crop the image, which is where I call the CropImage.
This is the contract:
However, when I call the method, the CropImage's Activity is called and is immediately closed returning the Uri as null.
This is what I was able to see in the log (I don't know if it's related but it appears every time I press the button) :
I have another feature which is the creation of a profile, there I call this contract and everything is working correctly:
The problem is only when I already send Uri directly.
Am I doing something wrong?
To Reproduce
Call CropImage Passing the Uri from fragment:
Expected behavior
Open the CropImage activity to crop the provided Uri
Screenshots
If applicable, add screenshots to help explain your problem.
Smartphone (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: