3333import com .regula .documentreader .api .errors .DocumentReaderException ;
3434import com .regula .documentreader .api .internal .core .CoreScenarioUtil ;
3535import com .regula .documentreader .api .params .DocReaderConfig ;
36+ import com .regula .documentreader .api .params .ImageInputData ;
3637import com .regula .documentreader .api .params .ImageInputParam ;
3738import com .regula .documentreader .api .params .rfid .PKDCertificate ;
3839import com .regula .documentreader .api .params .rfid .authorization .PAResourcesIssuer ;
@@ -253,6 +254,9 @@ public void error(String s) {
253254 case "stopRFIDReader" :
254255 stopRFIDReader (callback );
255256 break ;
257+ case "stopRFIDReaderWithErrorMessage" :
258+ stopRFIDReaderWithErrorMessage (callback , args (0 ));
259+ break ;
256260 case "stopScanner" :
257261 stopScanner (callback );
258262 break ;
@@ -358,9 +362,6 @@ public void error(String s) {
358362 case "initializeReaderWithDatabase" :
359363 initializeReaderWithDatabase (callback , args (0 ), args (1 ));
360364 break ;
361- case "recognizeImageFrame" :
362- recognizeImageFrame (callback , args (0 ), args (1 ));
363- break ;
364365 case "recognizeImageWithOpts" :
365366 recognizeImageWithOpts (callback , args (0 ), args (1 ));
366367 break ;
@@ -370,12 +371,12 @@ public void error(String s) {
370371 case "showScannerWithCameraIDAndOpts" :
371372 showScannerWithCameraIDAndOpts (callback , args (0 ), args (1 ));
372373 break ;
373- case "recognizeImageWithImageInputParams" :
374- recognizeImageWithImageInputParams (callback , args (0 ), args (1 ));
375- break ;
376374 case "recognizeImageWithCameraMode" :
377375 recognizeImageWithCameraMode (callback , args (0 ), args (1 ));
378376 break ;
377+ case "recognizeImagesWithImageInputs" :
378+ recognizeImagesWithImageInputs (callback , args (0 ));
379+ break ;
379380 }
380381 } catch (Exception ignored ) {
381382 }
@@ -548,10 +549,6 @@ private void startNewPage(Callback callback) {
548549 callback .success ();
549550 }
550551
551- private void recognizeImageWithImageInputParams (@ SuppressWarnings ("unused" ) Callback callback , String base64Image , final JSONObject params ) throws JSONException {
552- Instance ().recognizeImage (Helpers .bitmapFromBase64 (base64Image ), new ImageInputParam (params .getInt ("width" ), params .getInt ("height" ), params .getInt ("type" )), getCompletion ());
553- }
554-
555552 private void recognizeImageWithOpts (Callback callback , String base64Image , final JSONObject opts ) throws JSONException {
556553 RegulaConfig .setConfig (Instance (), opts , getContext ());
557554 recognizeImage (callback , base64Image );
@@ -570,6 +567,14 @@ private void recognizeImages(@SuppressWarnings("unused") Callback callback, JSON
570567 Instance ().recognizeImages (images , getCompletion ());
571568 }
572569
570+ private void recognizeImagesWithImageInputs (@ SuppressWarnings ("unused" ) Callback callback , JSONArray base64Images ) throws JSONException {
571+ stopBackgroundRFID ();
572+ ImageInputData [] images = new ImageInputData [base64Images .length ()];
573+ for (int i = 0 ; i < images .length ; i ++)
574+ images [i ] = JSONConstructor .ImageInputDataFromJSON (base64Images .getJSONObject (i ));
575+ Instance ().recognizeImages (images , getCompletion ());
576+ }
577+
573578 private void removeDatabase (Callback callback ) {
574579 callback .success (Instance ().removeDatabase (getContext ()));
575580 }
@@ -603,10 +608,6 @@ private void clearPKDCertificates(Callback callback) {
603608 callback .success ();
604609 }
605610
606- private void recognizeImageFrame (@ SuppressWarnings ("unused" ) Callback callback , String base64Image , final JSONObject opts ) throws JSONException {
607- Instance ().recognizeImageFrame (Helpers .bitmapFromBase64 (base64Image ), new ImageInputParam (opts .getInt ("width" ), opts .getInt ("height" ), opts .getInt ("type" )), getCompletion ());
608- }
609-
610611 private void recognizeVideoFrame (@ SuppressWarnings ("unused" ) Callback callback , String byteString , final JSONObject opts ) throws JSONException {
611612 stopBackgroundRFID ();
612613 Instance ().recognizeVideoFrame (byteString .getBytes (), new ImageInputParam (opts .getInt ("width" ), opts .getInt ("height" ), opts .getInt ("type" )), getCompletion ());
@@ -725,6 +726,10 @@ private void getCameraSessionIsPaused(Callback callback) {
725726 callback .error ("getCameraSessionIsPaused() is an ios-only method" );
726727 }
727728
729+ private void stopRFIDReaderWithErrorMessage (Callback callback , String message ) {
730+ callback .error ("stopRFIDReaderWithErrorMessage() is an ios-only method" );
731+ }
732+
728733 @ SuppressWarnings ("unused" )
729734 private void recognizeImageWithCameraMode (Callback callback , String base64 , boolean mode ) {
730735 callback .error ("recognizeImageWithCameraMode() is an ios-only method" );
0 commit comments