Commit 63eecdf
authored
fix: invalid zoom lead to cv2 error (#257)
- fix a bug where zoom factor <= 0 raises an exception at runtime
- now zoom factor <=0 will result in no scaling of the image
Related report from user:
https://unstructuredw-kbe4326.slack.com/archives/C044N0YV08G/p1697456659162509
Test:
This PR adds a unit test with cases where zoom factor is 0 or -1.
Without this fix the same error the user reported shows up:
```
error: (-215:Assertion failed) inv_scale_x > 0 in function 'resize'
```1 parent dbb203a commit 63eecdf
File tree
4 files changed
+19
-1
lines changed- test_unstructured_inference/models
- unstructured_inference
- models
4 files changed
+19
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
1 | 5 | | |
2 | 6 | | |
3 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
605 | 605 | | |
606 | 606 | | |
607 | 607 | | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
608 | 619 | | |
609 | 620 | | |
610 | 621 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
719 | 719 | | |
720 | 720 | | |
721 | 721 | | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
722 | 725 | | |
723 | 726 | | |
724 | 727 | | |
| |||
0 commit comments