Woonivers / react-native-document-scanner

Document scanner, features live border detection, perspective correction, image filters and more ! 📲📸
MIT License
85 stars 71 forks source link

Android just takes BLACK & WHITE picture #32

Open AllanLotta opened 4 years ago

AllanLotta commented 4 years ago

In Iphone i can get a color picture but in Android the lib just return a black & white.

Can someone help me?

"react-native": "0.59.9", "@woonivers/react-native-document-scanner": "1.6.2"

image

wwasuu commented 4 years ago

/android/src/main/java/com/documentscanner/ImageProcessor.java

carbon

AllanLotta commented 4 years ago

Thanks @wwasuu , It's works!

erie-e9 commented 4 years ago

Same problem but I didn´t understand how to solve it. Help

AllanLotta commented 4 years ago

@Eric-Andrade You need change the code of the lib for solve it. Go to node_modules/@woonivers/react-native-document-scanner/android/src/main/java/com/documentscanner/ImageProcessor.java and comment the line Imgproc.cvtColor(src, src, Imgproc.COLOR_RGBA2GRAY);

like this: image

anjenkuhn commented 3 years ago

@Woonivers ... Please remove this or at least add a parameter for switching it off and on. thank you.