Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
56f17e49
Commit
56f17e49
authored
Sep 17, 2015
by
Roman Donchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test2.py: fail if a downloaded image can't be decoded
parent
293ea03d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
test2.py
modules/python/test/test2.py
+3
-1
No files found.
modules/python/test/test2.py
View file @
56f17e49
...
@@ -13,7 +13,9 @@ class NewOpenCVTests(unittest.TestCase):
...
@@ -13,7 +13,9 @@ class NewOpenCVTests(unittest.TestCase):
def
get_sample
(
self
,
filename
,
iscolor
=
cv
.
CV_LOAD_IMAGE_COLOR
):
def
get_sample
(
self
,
filename
,
iscolor
=
cv
.
CV_LOAD_IMAGE_COLOR
):
if
not
filename
in
self
.
image_cache
:
if
not
filename
in
self
.
image_cache
:
filedata
=
urllib
.
urlopen
(
"https://raw.github.com/Itseez/opencv/2.4/"
+
filename
)
.
read
()
filedata
=
urllib
.
urlopen
(
"https://raw.github.com/Itseez/opencv/2.4/"
+
filename
)
.
read
()
self
.
image_cache
[
filename
]
=
cv2
.
imdecode
(
np
.
fromstring
(
filedata
,
dtype
=
np
.
uint8
),
iscolor
)
image
=
cv2
.
imdecode
(
np
.
fromstring
(
filedata
,
dtype
=
np
.
uint8
),
iscolor
)
self
.
assertFalse
(
image
is
None
)
self
.
image_cache
[
filename
]
=
image
return
self
.
image_cache
[
filename
]
return
self
.
image_cache
[
filename
]
def
setUp
(
self
):
def
setUp
(
self
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment