Skip to content

Commit

Permalink
Cleanup trailing whitespace in OCR (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
rw-access authored Nov 7, 2023
1 parent 8881d09 commit 491d32a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,6 @@ More documentation about Strelka can be found in the [README](https://target.git
## Contribute
Guidelines for contributing can be found [here](https://github.com/target/strelka/blob/master/CONTRIBUTING.md).

## Known Issues
There is currently a known issue with compilation on ARM based hosts (e.g., Apple M1). Attempting to compile the current version of Strelka will lead to the following issue:
https://github.com/target/strelka/issues/188. You can bypass this compilation issue by removing `pymupdf` from the backend Python `requirements.txt` file and commenting out ScanPDF in the `backend.yml` file. Doing this will allow you to compile the current version of Strelka at the expense of being unable to scan PDF files.

## Related Projects
* [Laika BOSS](https://github.com/lmco/laikaboss)
* [File Scanning Framework](https://github.com/EmersonElectricCo/fsf)
Expand Down
3 changes: 3 additions & 0 deletions src/python/strelka/scanners/scan_ocr.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ def scan(self, data, file, options, expire_at):
with open(tess_txt_name, 'rb') as tess_txt:
ocr_file = tess_txt.read().rstrip()

# Convert line endings and strip trailing whitespace per line
ocr_file = b'\n'.join([line.rstrip() for line in ocr_file.splitlines()])

if ocr_file:
self.event['raw'] = ocr_file

Expand Down

0 comments on commit 491d32a

Please sign in to comment.