Skip to content

fin-ocr-cli generates bad images #8

Description

@aaronreed708

Bug Report

Steps to Reproduce:

  1. clone and build fin-ocr-cli
  2. run ./scripts/ocr check generate 1
  3. run ./scripts/ocr check scan ~/.fin-ocr/checks/check-1.png

Expected Result:

User should see a JSON data structures containing the generated check information. Something like:

{
    "id": "/Users/aaron/.fin-ocr/checks/check-1.png",
    "translators": {
        "tesseract": {
            "result": {
                "micrLine": "[aoe 2 ete eee ie. - Lee Se\n",
                "routingNumber": "",
                "accountNumber": "",
                "checkNumber": ""
            }
        },
        "opencv": {
            "result": {
                "micrLine": "T751116251T259233723U4437",
                "routingNumber": "751116251",
                "accountNumber": "259233723",
                "checkNumber": "4437"
            }
        }
    },
    "overlap": true
}

Actual Result:

Sending scan request for ID: /Users/aaron/.fin-ocr/checks/check-1.png
Error processing file /Users/aaron/.fin-ocr/checks/check-1.png: Error: Failed to decode image/png: unrecognised content at end of stream
    at Util.bufferToMat (file:///Users/aaron/crap/fin-ocr-sdk/build/src/util.js:38:19)
    at Image.fromBuffer (file:///Users/aaron/crap/fin-ocr-sdk/build/src/image.js:52:26)
    at Check.getMicrLine (file:///Users/aaron/crap/fin-ocr-sdk/build/src/check.js:158:25)
    at Check.scan (file:///Users/aaron/crap/fin-ocr-sdk/build/src/check.js:41:37)
    at CheckMgr.getScanResponse (file:///Users/aaron/crap/fin-ocr-cli/build/check.js:271:42)
    at CheckMgr.scan (file:///Users/aaron/crap/fin-ocr-cli/build/check.js:203:31)
    at checkScan (file:///Users/aaron/crap/fin-ocr-cli/build/main.js:134:41)
    at async check (file:///Users/aaron/crap/fin-ocr-cli/build/main.js:51:13)
    at async main (file:///Users/aaron/crap/fin-ocr-cli/build/main.js:32:9)

Environment:

Issue noticed on fin-ocr-cli main yesterday using fin-ocr-sdk@1.0.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions