-
Notifications
You must be signed in to change notification settings - Fork 130
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
could not invoke CustomCropManager.crop #26
Comments
@Michaelvilleneuve any idea?, I have linked manually, here is the code.
|
Have you properly installed OpenCV as suggested in the Readme ? This step needs to be done manually |
Thanks for the quick response, followed the same steps in read me, the cropper shows on clicking on the crop text in example, it shows error. opencv is configured in project.
|
same problem here, any sugestion? |
@Michaelvilleneuve any suggestions? |
Ok, obviously there seem to be a documentation problem, I am not sure which step I missed in the doc but I'll try to list the changes made to our project : Here is our settings.gradle :
Since we are using package.json
settings.gradle :
notice the path change build.gradle
MainAplication.java
Thing to note, though I seriously doubt this has anything to do with this error : <manifest xmlns:android="http://schemas.android.com/apk/res/android"
// The below line was added
xmlns:tools="http://schemas.android.com/tools">
<application
// The below line was added
tools:replace="android:allowBackup"
android:name=".MainApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher" If you have followed exactly this, it may have something to do with the fact that we use openCV from my other lib "react-native-document-scanner": "Michaelvilleneuve/react-native-document-scanner#android", and use this OpenCV in settings.gradle
If it helped please tell me so I can update the code or documentation |
@Michaelvilleneuve same issue exits,i have followed the steps once again, let us find the exact problem. I have my source in this Dropbox link. Please check the source, it seems everyone has this issue, let's solve this issue. |
Have you tried using react-native-document-scanner as source for open CV lib ? |
No, let me check that. Thanks |
i think we should pass uri using react-native-camera package , cause Imgcodecs.imread(imageUri.replace("file://", ""), Imgproc.COLOR_BGR2RGB) ,that type of function written in the bridge RNCustomCropModule.java , check crop method in RNCustomCropModule.java my assumptions -_- |
Tried this, but facing same issue |
|
@zahidahmed024, may i know, how you have linked opencv manually, which you have mentioned in this link does crop works? |
actually i used https://www.npmjs.com/package/react-native-opencv3 this package ,and paste the crop method and imports in RNOpencv3Module.java file check my code take photo using camera i dont know weather it is right way or wrong -- |
@zahidahmed024, after cropping image , crop() function can't return any values, it's return error. any idea about this? |
capture image from camera , and check in console.log that u are getting uri like |
@zahidahmed024 my log url is
tried with replace "content" to "file" manually, throws same error, any suggestions |
@Michaelvilleneuve any suggestions regarding this issue. |
@Sride hey i solved that issue by providing image path ,, imgcodecs.imread() function can read original path . see the changes ,
*sometimes imagepicker package gives uri like file:/// sometimes like content:// ,also uri changes when u put your phone on usb , i donno if u faced this situation too -_- |
@zahidahmed024 Thanks a lot, it works like a charm.. |
@Sride actually this library is beautifully written by @Michaelvilleneuve . but installing opencv in native android or react native is always a pain and image picker uri problem -_- |
Yes @zahidahmed024 this is unique library, thanks for giving such a library @Michaelvilleneuve, really opencv integration is a pain. |
@zahidahmed024 I tried with your proposed solution, but it does not work :( |
I found the solution.
you also have to install opencv using this script
|
Okay. After struggle fof 2days,here is how i solve the issue completely.
|
I'm getting issue when scanning is done the area in which scanning is done but the image is croppping somewhere else. |
The easiest way to integrate openCV for me was to add |
@SL-A-SH and @jackyleehong : Could you please explain more about the way you setup your project? Also if you have a repo, that would be helpful. I am struggling to set this up |
Hi, please send your project. or uninstall
react-native-perspective-image-cropper, install "react-native-opencv3":
"^1.0.4",after that create, Custom crop component separately . then pass
the arguments through props to Custom crop component (where you
want 😊 👍).if any clarification please let me know.
…On Tue, Nov 12, 2019 at 2:58 AM srinivas valekar ***@***.***> wrote:
@SL-A-SH <https://github.com/SL-A-SH> and @jackyleehong
<https://github.com/jackyleehong> : Could you please explain more about
the way you setup your project? Also if you have a repo, that would be
helpful. I am struggling to set this up
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#26?email_source=notifications&email_token=AIJMT7J4G4SZZVM43DVLWT3QTHFARA5CNFSM4H2RF6PKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDYGBPA#issuecomment-552624316>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIJMT7OXPOBIAWWJYJFWEUTQTHFARANCNFSM4H2RF6PA>
.
--
Thanks and Regards,
Elango.K
|
@ElangoPrince : Thanks for the info! This react-native-opencv3 looks like really an amazing project. I would let you know once I update my code-base. :) |
@zahidahmed024 : i cant able to use library's function in ios. Please help me i cant use .crop method in ios how can i add .crop method manually? |
having the same issue and tried everything... this lib just doesn't work :( |
I still haven't been able to succeed. Could you please tell me if you had previously installed opencv in Android Studio? Do you have a working example I can use? Thanks in advance. |
@ethienneroy your solution actually works.. but it increases the size of my final apk by up to 25MB 😧 Because the library size is huge Update : Actually I believe @Michaelvilleneuve forgot to include it here |
For me, this happens only on android. Image path returned from RN Camera is: Image pathe returned from scanner is: "file:///data/user/0/com.my_app/cache/documents/351b8cab-eb13-4851-918a-0e7218c7278a.jpg" The only difference is in these paths, everything else is the same. |
Adding this "RNCustomCropModule.java" worked for me. |
Hi guys, |
I'm getting this in Android- I am using your forked library. Can you help with this? |
in line 50 : Mat src = Imgcodecs.imread(imageUri.replace("file://", ""), Imgproc.COLOR_BGR2RGB); |
Michaelvilleneuve/react-native-perspective-image-cropper#26 1. Check @Sride answer (change input of Imgcodecs.imread to file path) 2. install this https://github.com/Michaelvilleneuve/react-native-document-scanner/tree/master/android/src/main/jniLibs
Can you pls share location where you add this. I'm using perspective-cropper pkg |
In IOS After Capturing image cropping is not working properly. Anyone has managed to solve this issue? Thanks in advance.. |
For anyone else running into this annoying error, it seems that the documentation is just wrong. The |
on cropping image, shows error.
The text was updated successfully, but these errors were encountered: