]> www.vanbest.org Git - motioneye-debian/commitdiff
fixed editable mask shifting on some unusual resolutions
authorCalin Crisan <ccrisan@gmail.com>
Tue, 24 Jan 2017 15:40:01 +0000 (17:40 +0200)
committerCalin Crisan <ccrisan@gmail.com>
Tue, 24 Jan 2017 15:40:01 +0000 (17:40 +0200)
motioneye/utils.py
motioneye/wsswitch.py

index 4d52ff3336e1b3f0adc73d0ee0b0b8ae5efc1c69..34e5bd71f3997217ce9a0967639a72bcbabb1d6d 100644 (file)
@@ -829,11 +829,11 @@ def build_editable_mask_file(camera_id, mask_lines, capture_width=None, capture_
 
     # scale the mask vertically in case the aspect ratio has changed
     # since the last time the mask has been generated
-    if mask_height == len(mask_lines):
+    if ny == len(mask_lines):
         line_index_func = lambda y: y
         
     else:
-        line_index_func = lambda y: (len(mask_lines) - 1) * y / (mask_height - 1)
+        line_index_func = lambda y: (len(mask_lines) - 1) * y / (ny - 1)
 
     rh = height / ny # rectangle height
 
index 74895bde8dfe95b0f917b667c3a5176c7cd0a154..3c34afb22d23105b841a8570003b2ef69a76f1c4 100644 (file)
@@ -81,7 +81,8 @@ def _check_ws():
     
     def on_motion_detection_status(camera_id, must_be_enabled, working_schedule_type, enabled=None, error=None):
         if error: # could not detect current status
-            return logging.warn('skipping motion detection status update for camera with id %(id)s' % {'id': camera_id})
+            return logging.warn('skipping motion detection status update for camera with id %(id)s: %(error)s' % {
+                    'id': camera_id, 'error': error})
             
         if enabled and not must_be_enabled:
             logging.debug('must disable motion detection for camera with id %(id)s (%(what)s working schedule)' % {