BlinkReceipt / blinkreceipt-android

MIT License
49 stars 16 forks source link

How to recognize an Image bitmap? #18

Closed Prince-Mittal closed 3 years ago

Prince-Mittal commented 3 years ago

Hi, I'm trying to get the scan data from an image selected from the gallery instead of using the recognizer view provided. In the old sdk version I have implemented it using recognizer. But as the recognizer is a private class now and not accessible anymore is there any other way to achieve it in the latest version of the sdk. The old code I was using is mentioned below :-

       Bitmap imgBitmap = getBitmap(stringUri);
        Recognizer.getInstance(reactContext).initialize(getOptions());
        Recognizer.getInstance( reactContext ).recognize(new SimpleRecognizerCallback() {

            @Override
            public void onRecognizerDone(@NonNull final ScanResults results, @NonNull final Media media ) {
                super.onRecognizerDone( results, media );

                promise.resolve(parseResultToJson(results));
            }

            @Override
            public void onRecognizerResultsChanged(@NonNull RecognizerResult recognizerResult) {
                super.onRecognizerResultsChanged(recognizerResult);
                promise.resolve(parseRecognizerToJson(recognizerResult));
            }
        }, CameraOrientation.ORIENTATION_PORTRAIT, imgBitmap) ;
pequots34 commented 3 years ago

Hi @Prince-Mittal , This is now a premium feature. If you are a client of ours please reach out to support to discuss eligibility.

Thank you