question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

What is the best way to get this library to work with perspective image cropper

See original GitHub issue

Hi,

I am trying to do perspective image cropping once an image is captured. The rectangle coordinates would be used as the overlay. I have tried with the react-native-perspective-image-cropper but cannot make the crop actually work. Is there another option for perspective image cropping that can be recommended or a working example of react-native-rectangle-scanner and ``react-native-perspective-image-cropper`? Thank you.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:3
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
rosentoshevcommented, Sep 1, 2020

@chunkydonut21 Yes, I made a working prototype version though it is with a local version of the react-native-perspective-image-cropper that I have, which is based on several people fixing issues with Android compatibility and the cropper cropping inaccurately. The functioning prototype, without my local version react-native-perspective-image-cropper can be found here: https://github.com/rosenexpend/rectangle-scanner-example

0reactions
humphreyjacommented, Aug 4, 2020

@chunkydonut21 sorry, I spent a few minutes on this the other day and didn’t come up with something usable for you unfortunately. I think personally what I would do is actually just fork that project and simply replace the base64 return portion of that package with the file saving approach of this package.

For Android, here is the function that is called with the final image(s) and the steps I take to save them to storage before returning the URI to that saved image. https://github.com/HarvestProfit/react-native-rectangle-scanner/blob/master/android/src/main/java/com/rectanglescanner/views/RNRectangleScannerView.java#L119-L163

Here is the same for iOS: https://github.com/HarvestProfit/react-native-rectangle-scanner/blob/master/ios/RNRectangleScannerView.m#L95-L157

Like I said, everything should work the same, it’s just replacing how you interact with the image. If you get something solid working, be sure to share it as this is definitely something that people would like!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Has anyone gotten the react-native-perspective-image ...
Hello, I am trying to add the react-native-perspective-image-cropper on ... I have gotten the library to work on Android and crop according ...
Read more >
react-native-perspective-image-cropper - npm
React native library allowing you to make custom crop and perspective corrections on photos. Latest version: 0.4.4, last published: 3 years ...
Read more >
Python PIL | Image.crop() method - GeeksforGeeks
PIL is the Python Imaging Library which provides the python interpreter with image editing capabilities. PIL.Image.crop() method is used to crop ...
Read more >
Crop images in Photoshop Elements - Adobe Support
Cropping · Crop an image · Crop to a selection boundary · Automatic cropping suggestions · Perspective Crop tool · Use the Cookie...
Read more >
react-native-perspective-image-cropper - npm package - Snyk
React native library allowing you to make custom crop and perspective corrections on photos For more information about how to use this package...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found