CanHub / Android-Image-Cropper

Image Cropping Library for Android, optimised for Camera / Gallery.
Apache License 2.0
1.21k stars 249 forks source link

Crop is not working when I click Image from camera In Android 11 #7

Closed akkie2106 closed 3 years ago

akkie2106 commented 3 years ago

getting Null in intent data while clicking the image from the camera in Android 11 below in data i'm getting null in intent data @Override @SuppressLint("NewApi") protected void onActivityResult(int requestCode, int resultCode, Intent data) {

    // handle result of pick image chooser
    super.onActivityResult(requestCode, resultCode, data);
    if (requestCode == CropImage.PICK_IMAGE_CHOOSER_REQUEST_CODE) {
        if (resultCode == Activity.RESULT_CANCELED) {
            // User cancelled the picker. We don't have anything to crop
            setResultCancel();

        }

        if (resultCode == Activity.RESULT_OK) {
            mCropImageUri = CropImage.getPickImageResultUri(this, data);
            savedState.putString("mCropImageUri", mCropImageUri.toString());

            // For API >= 23 we need to check specifically that we have permissions to read external
            // storage.
            if (CropImage.isReadExternalStoragePermissionsRequired(this, mCropImageUri)) {
                // request permissions and handle the result in onRequestPermissionsResult()
                requestPermissions(
                        new String[]{Manifest.permission.READ_EXTERNAL_STORAGE},
                        CropImage.PICK_IMAGE_PERMISSIONS_REQUEST_CODE);
            } else {
                // no permissions required or already grunted, can start crop image activity
                mCropImageView.setImageUriAsync(mCropImageUri);
            }
        }
    } else {
        Toast.makeText(CropImageActivity.this, "Pressed Back", Toast.LENGTH_SHORT).show();
        finish();

    }

}
akkie2106 commented 3 years ago

@Canato it's from camera otherwise it is working fine with other apps like Files And photos I'm getting null in intent data while clicking the image from the camera on the Android 11 device.

Canato commented 3 years ago

Thanks @akkie2106 now that I have more information I can confirm, this is related to #3 Until this issue is done, we will not have a fix for it.

I'm working on the issue to have a proper fix soon.

akkie2106 commented 3 years ago

Thanks @akkie2106 now that I have more information I can confirm, this is related to #3 Until this issue is done, we will not have a fix for it.

I'm working on the issue to have a proper fix soon.

Thank you @Canato

akkie2106 commented 3 years ago

@Canato is there any update about the issue that I have raised

Canato commented 3 years ago

When #3 is fixed and we open a PR for this we will release a new version with the fix, until there people are working on the solution. If you already spot, please open a PR

akkie2106 commented 3 years ago

oke I found a solution for this open directly camera for clicking image and then directly pass URI for cropping. image image @Canato @ravindu1024 it is working

akkie2106 commented 3 years ago

If you find the solution to #3, please let me know @Canato @ravindu1024 Thank you

akkie2106 commented 3 years ago

@akkie2106 Where does that code go?

There is a thing in Android studio You can simply use i.e Debugging use it You will find @Harld123

Harld123 commented 3 years ago

@akkie2106 @ravindu1024

is there a way to not show the camera option without removing the following from the Manifest file:

`

</queries>

`

akkie2106 commented 3 years ago

@Harld123 go through the cropper code you'll find definitely

either remove camera intents

SaltyBoi31 commented 2 years ago

oke I found a solution for this open directly camera for clicking image and then directly pass URI for cropping. image image @Canato @ravindu1024 it is working

@akkie2106 can you please send your java file? I'm having trouble implementing what you have said.

akkie2106 commented 2 years ago

Hi team, I'll send tomorrow because currently I'm on vacation.

On Sun, 2 Jan, 2022, 14:17 SaltyBoi31, @.***> wrote:

oke I found a solution for this open directly camera for clicking image and then directly pass URI for cropping. [image: image] https://user-images.githubusercontent.com/67181037/101163543-be710800-3659-11eb-88d6-353812a50e95.png [image: image] https://user-images.githubusercontent.com/67181037/101163628-dfd1f400-3659-11eb-8e4e-23d41e35cbe4.png @Canato https://github.com/Canato @ravindu1024 https://github.com/ravindu1024 it is working

@akkie2106 https://github.com/akkie2106 can you please send your java file? I'm having trouble implementing what you have said.

— Reply to this email directly, view it on GitHub https://github.com/CanHub/Android-Image-Cropper/issues/7#issuecomment-1003682374, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQART3KKFNZ3U74AFAANQ7TUUAGJBANCNFSM4UI5IGJQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

SaltyBoi31 commented 2 years ago

Hi team, I'll send tomorrow because currently I'm on vacation. On Sun, 2 Jan, 2022, 14:17 SaltyBoi31, @.> wrote: oke I found a solution for this open directly camera for clicking image and then directly pass URI for cropping. [image: image] https://user-images.githubusercontent.com/67181037/101163543-be710800-3659-11eb-88d6-353812a50e95.png [image: image] https://user-images.githubusercontent.com/67181037/101163628-dfd1f400-3659-11eb-8e4e-23d41e35cbe4.png @Canato https://github.com/Canato @ravindu1024 https://github.com/ravindu1024 it is working @akkie2106 https://github.com/akkie2106 can you please send your java file? I'm having trouble implementing what you have said. — Reply to this email directly, view it on GitHub <#7 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQART3KKFNZ3U74AFAANQ7TUUAGJBANCNFSM4UI5IGJQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you were mentioned.Message ID: @.>

@akkie2106 Good day! Is it now possible for you to send the java file?

rafibr commented 2 years ago

Hi team, I'll send tomorrow because currently I'm on vacation. On Sun, 2 Jan, 2022, 14:17 SaltyBoi31, @.> wrote: oke I found a solution for this open directly camera for clicking image and then directly pass URI for cropping. [image: image] https://user-images.githubusercontent.com/67181037/101163543-be710800-3659-11eb-88d6-353812a50e95.png [image: image] https://user-images.githubusercontent.com/67181037/101163628-dfd1f400-3659-11eb-8e4e-23d41e35cbe4.png @Canato https://github.com/Canato @ravindu1024 https://github.com/ravindu1024 it is working @akkie2106 https://github.com/akkie2106 can you please send your java file? I'm having trouble implementing what you have said. — Reply to this email directly, view it on GitHub <#7 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQART3KKFNZ3U74AFAANQ7TUUAGJBANCNFSM4UI5IGJQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you were mentioned.Message ID: @.>

@akkie2106 Hi, can you send the java file? i have a problem implement this, Thank you

akkie2106 commented 2 years ago

Sure, no problem. Please find the whole project https://drive.google.com/file/d/1-VBQjU85pHizYtAzb-Oyh8xpqnEDGOK-/view?usp=drivesdk

On Fri, 14 Jan, 2022, 13:42 Muhammad Rafi B.R., @.***> wrote:

Hi team, I'll send tomorrow because currently I'm on vacation. … <#m-8663672560202519397> On Sun, 2 Jan, 2022, 14:17 SaltyBoi31, @.> wrote: oke I found a solution for this open directly camera for clicking image and then directly pass URI for cropping. [image: image] https://user-images.githubusercontent.com/67181037/101163543-be710800-3659-11eb-88d6-353812a50e95.png https://user-images.githubusercontent.com/67181037/101163543-be710800-3659-11eb-88d6-353812a50e95.png [image: image] https://user-images.githubusercontent.com/67181037/101163628-dfd1f400-3659-11eb-8e4e-23d41e35cbe4.png https://user-images.githubusercontent.com/67181037/101163628-dfd1f400-3659-11eb-8e4e-23d41e35cbe4.png @Canato https://github.com/Canato https://github.com/Canato https://github.com/Canato @ravindu1024 https://github.com/ravindu1024 https://github.com/ravindu1024 https://github.com/ravindu1024 it is working @akkie2106 https://github.com/akkie2106 https://github.com/akkie2106 https://github.com/akkie2106 can you please send your java file? I'm having trouble implementing what you have said. — Reply to this email directly, view it on GitHub <#7 (comment) https://github.com/CanHub/Android-Image-Cropper/issues/7#issuecomment-1003682374>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQART3KKFNZ3U74AFAANQ7TUUAGJBANCNFSM4UI5IGJQ https://github.com/notifications/unsubscribe-auth/AQART3KKFNZ3U74AFAANQ7TUUAGJBANCNFSM4UI5IGJQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you were mentioned.Message ID: @.>

@akkie2106 https://github.com/akkie2106 Hi, can you send the java file? i have a problem implement this, Thank you

— Reply to this email directly, view it on GitHub https://github.com/CanHub/Android-Image-Cropper/issues/7#issuecomment-1012900884, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQART3OUAJXS5U3NWJBZ5SLUV7LIRANCNFSM4UI5IGJQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

SaltyBoi31 commented 2 years ago

Sure, no problem. Please find the whole project https://drive.google.com/file/d/1-VBQjU85pHizYtAzb-Oyh8xpqnEDGOK-/view?usp=drivesdk On Fri, 14 Jan, 2022, 13:42 Muhammad Rafi B.R., @.> wrote: Hi team, I'll send tomorrow because currently I'm on vacation. … <#m-8663672560202519397> On Sun, 2 Jan, 2022, 14:17 SaltyBoi31, @.> wrote: oke I found a solution for this open directly camera for clicking image and then directly pass URI for cropping. [image: image] https://user-images.githubusercontent.com/67181037/101163543-be710800-3659-11eb-88d6-353812a50e95.png https://user-images.githubusercontent.com/67181037/101163543-be710800-3659-11eb-88d6-353812a50e95.png [image: image] https://user-images.githubusercontent.com/67181037/101163628-dfd1f400-3659-11eb-8e4e-23d41e35cbe4.png https://user-images.githubusercontent.com/67181037/101163628-dfd1f400-3659-11eb-8e4e-23d41e35cbe4.png @Canato https://github.com/Canato https://github.com/Canato https://github.com/Canato @ravindu1024 https://github.com/ravindu1024 https://github.com/ravindu1024 https://github.com/ravindu1024 it is working @akkie2106 https://github.com/akkie2106 https://github.com/akkie2106 https://github.com/akkie2106 can you please send your java file? I'm having trouble implementing what you have said. — Reply to this email directly, view it on GitHub <#7 (comment) <#7 (comment)>>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQART3KKFNZ3U74AFAANQ7TUUAGJBANCNFSM4UI5IGJQ https://github.com/notifications/unsubscribe-auth/AQART3KKFNZ3U74AFAANQ7TUUAGJBANCNFSM4UI5IGJQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you were mentioned.Message ID: @.> @akkie2106 https://github.com/akkie2106 Hi, can you send the java file? i have a problem implement this, Thank you — Reply to this email directly, view it on GitHub <#7 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQART3OUAJXS5U3NWJBZ5SLUV7LIRANCNFSM4UI5IGJQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you were mentioned.Message ID: @.>

Thank you! I had to do a whole lot of other things to fix my issue, but your code helped a lot.

akkie2106 commented 2 years ago

You're welcome! Thank you

On Thu, 27 Jan, 2022, 15:01 SaltyBoi31, @.***> wrote:

Sure, no problem. Please find the whole project https://drive.google.com/file/d/1-VBQjU85pHizYtAzb-Oyh8xpqnEDGOK-/view?usp=drivesdk On Fri, 14 Jan, 2022, 13:42 Muhammad Rafi B.R., @.

*> wrote: … <#m3905082255789476166> Hi team, I'll send tomorrow because currently I'm on vacation. … <#m-8663672560202519397> On Sun, 2 Jan, 2022, 14:17 SaltyBoi31, @.> wrote: oke I found a solution for this open directly camera for clicking image and then directly pass URI for cropping. [image: image] https://user-images.githubusercontent.com/67181037/101163543-be710800-3659-11eb-88d6-353812a50e95.png https://user-images.githubusercontent.com/67181037/101163543-be710800-3659-11eb-88d6-353812a50e95.png https://user-images.githubusercontent.com/67181037/101163543-be710800-3659-11eb-88d6-353812a50e95.png https://user-images.githubusercontent.com/67181037/101163543-be710800-3659-11eb-88d6-353812a50e95.png [image: image] https://user-images.githubusercontent.com/67181037/101163628-dfd1f400-3659-11eb-8e4e-23d41e35cbe4.png https://user-images.githubusercontent.com/67181037/101163628-dfd1f400-3659-11eb-8e4e-23d41e35cbe4.png https://user-images.githubusercontent.com/67181037/101163628-dfd1f400-3659-11eb-8e4e-23d41e35cbe4.png https://user-images.githubusercontent.com/67181037/101163628-dfd1f400-3659-11eb-8e4e-23d41e35cbe4.png @Canato https://github.com/Canato https://github.com/Canato https://github.com/Canato https://github.com/Canato https://github.com/Canato https://github.com/Canato https://github.com/Canato @ravindu1024 https://github.com/ravindu1024 https://github.com/ravindu1024 https://github.com/ravindu1024 https://github.com/ravindu1024 https://github.com/ravindu1024 https://github.com/ravindu1024 https://github.com/ravindu1024 it is working @akkie2106 https://github.com/akkie2106 https://github.com/akkie2106 https://github.com/akkie2106 https://github.com/akkie2106 https://github.com/akkie2106 https://github.com/akkie2106 https://github.com/akkie2106 can you please send your java file? I'm having trouble implementing what you have said. — Reply to this email directly, view it on GitHub <#7 https://github.com/CanHub/Android-Image-Cropper/issues/7 (comment) <#7 (comment) https://github.com/CanHub/Android-Image-Cropper/issues/7#issuecomment-1003682374>>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQART3KKFNZ3U74AFAANQ7TUUAGJBANCNFSM4UI5IGJQ https://github.com/notifications/unsubscribe-auth/AQART3KKFNZ3U74AFAANQ7TUUAGJBANCNFSM4UI5IGJQ https://github.com/notifications/unsubscribe-auth/AQART3KKFNZ3U74AFAANQ7TUUAGJBANCNFSM4UI5IGJQ https://github.com/notifications/unsubscribe-auth/AQART3KKFNZ3U74AFAANQ7TUUAGJBANCNFSM4UI5IGJQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you were mentioned.Message ID: @.> @akkie2106 https://github.com/akkie2106 https://github.com/akkie2106 https://github.com/akkie2106 Hi, can you send the java file? i have a problem implement this, Thank you — Reply to this email directly, view it on GitHub <#7 (comment) https://github.com/CanHub/Android-Image-Cropper/issues/7#issuecomment-1012900884>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQART3OUAJXS5U3NWJBZ5SLUV7LIRANCNFSM4UI5IGJQ https://github.com/notifications/unsubscribe-auth/AQART3OUAJXS5U3NWJBZ5SLUV7LIRANCNFSM4UI5IGJQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you were mentioned.Message ID: @.***>

Thank you! I had to do a whole lot of other things to fix my issue, but your code helped a lot.

— Reply to this email directly, view it on GitHub https://github.com/CanHub/Android-Image-Cropper/issues/7#issuecomment-1023013213, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQART3LBCONLOUO4PAGF54LUYEGH5ANCNFSM4UI5IGJQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>