Skip to content

Commit

Permalink
Add missing color cut call
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Aug 17, 2022
1 parent 4291cab commit 6b6ce22
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,15 @@ 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
path: results
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 }}
Expand Down
5 changes: 3 additions & 2 deletions scan_to_paperless/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 6b6ce22

Please sign in to comment.