I want to take a picture and then crop it but i don't want to use a library for that, so i would like to know if there is a way to do it with any Intent
Asked
Active
Viewed 270 times
0
-
There is no `CROP` `Intent` in Android, if that is what you are asking. Why are you concerned about using libraries? – CommonsWare May 01 '21 at 14:55
-
What happen is that i'm using this library: [link](https://github.com/ArthurHub/Android-Image-Cropper) but i'm getting `Failed to load sampled bitmap ... open failed: ENOENT (No such file or directory)` when its taken from camera. – Jimmy ALejandro May 01 '21 at 15:35
-
It's only happening with Motorola ONe Macro, so i wanted to know if there is another way without a library – Jimmy ALejandro May 01 '21 at 15:36
-
Blaming libraries in general, or even this specific library, seems unwise if you do not know the root cause of the problem. For example, the problem could be in how you take the picture. If you are using `ACTION_IMAGE_CAPTURE`, the particular camera app that you used on that Motorola phone might have bugs. If anything, using libraries is the way to get more reliable results across the 26,000+ Android device models, compared to relying on one of hundreds of different pre-installed apps. – CommonsWare May 01 '21 at 15:40
-
@CommonsWare I'm not blamming libraries, even i could say it's a great library what i'm using, but i need to solve this problem, thank you so much. – Jimmy ALejandro May 01 '21 at 15:44
-
"i need to solve this problem" -- then I recommend that you ask a separate Stack Overflow question, with a [mcve] showing how you are taking the picture, how you are trying to use this library, and the complete stack trace associated with your error. – CommonsWare May 01 '21 at 16:02
1 Answers
0
I know how to take a photo from gallery someone can add camera if you take a photo from gallery and you will show it in your image view:
val intent = Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI)
startActivityForResult(intent,2)
and you will override onactivityresult 2 is a number for request code you can use a integer variable instead of this https://stackoverflow.com/a/31382240/15805169 I saw this but it uses Picasso library you have to implement it with this code
implementation 'com.squareup.picasso:picasso:2.71828'

Barney Stinson
- 212
- 3
- 12