From 6b6ce22544d86a154dddef510ec8ba420f2c0f59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Tue, 16 Aug 2022 22:17:52 +0200 Subject: [PATCH] Add missing color cut call --- .github/workflows/main.yaml | 8 ++------ scan_to_paperless/process.py | 5 +++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 1ecd1c7c..d5d22660 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -56,6 +56,8 @@ jobs: cd /tests && pytest --durations=0 -vv --color=yes --profile --profile-svg --junitxml=/results/test-reports/junit.xml .' + - run: sudo chmod -R go+r results || true + if: failure() - uses: actions/upload-artifact@v3 with: name: results @@ -63,12 +65,6 @@ jobs: if-no-files-found: ignore retention-days: 5 if: failure() - - uses: actions/upload-artifact@v3 - with: - name: Test report - path: results/test-reports - if-no-files-found: ignore - retention-days: 5 - run: make build-all - run: docker login --username=${{ secrets.DOCKER_USERNAME }} --password=${{ secrets.DOCKER_PASSWORD }} diff --git a/scan_to_paperless/process.py b/scan_to_paperless/process.py index 0d11510f..82a7edfc 100755 --- a/scan_to_paperless/process.py +++ b/scan_to_paperless/process.py @@ -561,8 +561,8 @@ def color_cut(context: Context) -> None: black_mask = cv2.inRange( grayscale, context.config["args"].setdefault("cut_black", schema.CUT_BLACK_DEFAULT), 0 ) - context.image[white_mask == 0] = (255, 255, 255) - context.image[black_mask == 0] = (0, 0, 0) + context.image[white_mask == 1] = (255, 255, 255) + context.image[black_mask == 1] = (0, 0, 0) @Process("mask-cut") @@ -941,6 +941,7 @@ def transform( image_status["size"] = list(context.image.shape[:2][::-1]) context.init_mask() level(context) + color_cut(context) cut(context) deskew(context) docrop(context)