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

Commit

Permalink
Hotfix loading resources other than webcams
Browse files Browse the repository at this point in the history
  • Loading branch information
shoeffner committed Jan 26, 2017
1 parent 8e4fcb8 commit d771f7d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
3 changes: 2 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ Provides cvloop, a way to show opencv video loops. Designed for jupyter notebook
Requirements
------------

(Recommended versions, additionally tested versions in parentheses)
(Recommended versions, additionally tested versions in parentheses.)

- Python 3.6 (3.5)
- OpenCV 3.2 (3.1)
- Jupyter 4.3.1
Expand Down
2 changes: 1 addition & 1 deletion cvloop/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
jupyter notebooks."""
import sys

__version__ = '0.3.0'
__version__ = '0.3.1'

OPENCV_FOUND = False
OPENCV_VERSION_COMPATIBLE = False
Expand Down
10 changes: 6 additions & 4 deletions cvloop/cvloop.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,12 @@ def __init__(self, source=None, function=lambda x: x, side_by_side=False,
dimensions, color channels, data type. Skips the
output of one frame.
"""
if source is not None and \
(isinstance(source, type(cv2.VideoCapture())) or
hasattr(source, 'read')):
self.capture = source
if source is not None:
if isinstance(source, type(cv2.VideoCapture())) \
or hasattr(source, 'read'):
self.capture = source
else:
self.capture = cv2.VideoCapture(source)
else:
self.capture = cv2.VideoCapture(0)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import sys


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

README = ''
Expand Down

0 comments on commit d771f7d

Please sign in to comment.