Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

Commit d771f7d

Browse files
committed
Hotfix loading resources other than webcams
1 parent 8e4fcb8 commit d771f7d

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

README.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ Provides cvloop, a way to show opencv video loops. Designed for jupyter notebook
3535
Requirements
3636
------------
3737

38-
(Recommended versions, additionally tested versions in parentheses)
38+
(Recommended versions, additionally tested versions in parentheses.)
39+
3940
- Python 3.6 (3.5)
4041
- OpenCV 3.2 (3.1)
4142
- Jupyter 4.3.1

cvloop/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
jupyter notebooks."""
33
import sys
44

5-
__version__ = '0.3.0'
5+
__version__ = '0.3.1'
66

77
OPENCV_FOUND = False
88
OPENCV_VERSION_COMPATIBLE = False

cvloop/cvloop.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,12 @@ def __init__(self, source=None, function=lambda x: x, side_by_side=False,
7575
dimensions, color channels, data type. Skips the
7676
output of one frame.
7777
"""
78-
if source is not None and \
79-
(isinstance(source, type(cv2.VideoCapture())) or
80-
hasattr(source, 'read')):
81-
self.capture = source
78+
if source is not None:
79+
if isinstance(source, type(cv2.VideoCapture())) \
80+
or hasattr(source, 'read'):
81+
self.capture = source
82+
else:
83+
self.capture = cv2.VideoCapture(source)
8284
else:
8385
self.capture = cv2.VideoCapture(0)
8486

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import sys
55

66

7-
VERSION = '0.3.0' # x.y.z[-dev#]
7+
VERSION = '0.3.1' # x.y.z[-dev#]
88
REPOSITORY = 'https://github.com/shoeffner/cvloop'
99

1010
README = ''

0 commit comments

Comments
 (0)