Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
zesje
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
zesje
zesje
Commits
aeeaa127
Commit
aeeaa127
authored
5 years ago
by
Hugo Kerstens
Browse files
Options
Downloads
Patches
Plain Diff
Add test for image extraction
parent
a90a2d25
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!137
Use Wand as a fallback for image extraction
Pipeline
#17407
passed
5 years ago
Stage: build
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/data/flattened-a4-2pages.pdf
+0
-0
0 additions, 0 deletions
tests/data/flattened-a4-2pages.pdf
tests/test_scans.py
+15
-0
15 additions, 0 deletions
tests/test_scans.py
with
15 additions
and
0 deletions
tests/data/flattened-a4-2pages.pdf
0 → 100644
+
0
−
0
View file @
aeeaa127
File added
This diff is collapsed.
Click to expand it.
tests/test_scans.py
+
15
−
0
View file @
aeeaa127
...
@@ -265,3 +265,18 @@ def test_all_effects(
...
@@ -265,3 +265,18 @@ def test_all_effects(
# image.show()
# image.show()
success
,
reason
=
scans
.
process_page
(
image
,
new_exam
,
datadir
)
success
,
reason
=
scans
.
process_page
(
image
,
new_exam
,
datadir
)
assert
success
is
expected
,
reason
assert
success
is
expected
,
reason
@pytest.mark.parametrize
(
'
filename
'
,
[
'
blank-a4-2pages.pdf
'
,
'
flattened-a4-2pages.pdf
'
],
ids
=
[
'
blank pdf
'
,
'
flattened pdf
'
])
def
test_image_extraction
(
datadir
,
filename
):
file
=
os
.
path
.
join
(
datadir
,
filename
)
page
=
0
for
img
,
pagenr
in
scans
.
extract_images
(
file
):
page
+=
1
assert
pagenr
==
page
assert
img
is
not
None
assert
np
.
average
(
np
.
array
(
img
))
==
255
assert
page
==
2
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment