thegrizzlylabs / geniusscan-sdk-demo

Demo apps for Genius Scan SDK
30 stars 39 forks source link

How to pass image to geniusscansdk in flutter? #84

Closed abdallah-odeh closed 4 months ago

abdallah-odeh commented 4 months ago

I am trying to process an image selected from gallery with Genius scan, but the plugin returns the following error:

PlatformException(GSKErrorDomain error 1003, Input image cannot be nil, null, null)

I assume that I implemented this correctly according to the documentation written in the code:

  /// * `source`: `camera`, `image` or `library` (defaults to camera)
  /// * `sourceImageUrl`: an absolute image url, required if `source` is `image`. Example: `file:///var/…/image.png`

      var result = await FlutterGeniusScan.scanWithConfiguration({
        'source': 'image',
        'sourceImageUrl': imagePath,
        'defaultFilter': 'photo',
      });

I also thought maybe the file itself does not exists so I checked that out by:

  print('IS FILE EXIST? ${await File(imagePath).exists()}');
  // and got in the log:
  flutter: IS FILE EXIST? true

so how to pass an image to process it?

bvirlet commented 4 months ago

Can you print imagePath ?

abdallah-odeh commented 4 months ago

It seems I had issue with the license key, issue solved. thank you so much