bendyworks / cap-ml

Text Detection Capacitor Plugin
Other
16 stars 16 forks source link

ImageOrientation required on detectText call (Android) #11

Closed thmclellan closed 4 years ago

thmclellan commented 4 years ago

Thanks for this wonderful plugin! It's been a great time saver.

While implementing on Android (with Ionic 4 / Capacitor), the plugin was crashing if I called detectText(filename) without specifying orientation. After passing in ImageOrientation.Up as a second parameter, like in your example project, things worked smoothly. This may be just a documentation issue.

vennelakodali commented 4 years ago

glad you found it useful. will fix up the documentation soon.

thmclellan commented 4 years ago

Thanks. Related to this issue, when passing ImageOrientation.Up as the second parameter on iOS, the plugin was returning no results on the first image, but would work as expected on the second image scan. If I don't pass in the orientation on iOS, then it works fine the first time. This was an iPhone X on 13.5.1 and there was no unusual logging in Xcode when the first scan failed. With a simple if statement workaround, it works fine on both platforms, just wanted to let you know.

vennelakodali commented 4 years ago

Thankyou - will take a look at that one as well.

vennelakodali commented 4 years ago

I couldn't reproduce the iphoneX bug, first image not being processed bug 🤔 rest should be fixed in #13