]> www.vanbest.org Git - motioneye-debian/commitdiff
fixed mask editing when no streaming resolution is available
authorCalin Crisan <ccrisan@gmail.com>
Sun, 13 Nov 2016 17:05:27 +0000 (19:05 +0200)
committerCalin Crisan <ccrisan@gmail.com>
Sun, 13 Nov 2016 17:05:27 +0000 (19:05 +0200)
motioneye/static/js/main.js

index 134e7af8bc631bc3d254e59917e894078045bb2f..e551f6244c9b548527c3ed79db60d9a3efe83c97 100644 (file)
@@ -908,11 +908,11 @@ function initUI() {
     $('div#editMaskButton').click(function () {
         var cameraId = $('#cameraSelect').val();
         var img = getCameraFrame(cameraId).find('img.camera')[0];
-        if (!img.naturalWidth || !img.naturalHeight) {
+        if (!img._naturalWidth || !img._naturalHeight) {
             return runAlertDialog('Cannot edit the mask without a valid camera image!');
         }
 
-        enableMaskEdit(cameraId, img.naturalWidth, img.naturalHeight);
+        enableMaskEdit(cameraId, img._naturalWidth, img._naturalHeight);
     });
     $('div#saveMaskButton').click(function () {
         disableMaskEdit();
@@ -4545,6 +4545,12 @@ function addCameraFrameUi(cameraConfig) {
         }
 
         this.loading = 0;
+        if (this.naturalWidth) {
+            this._naturalWidth = this.naturalWidth;
+        }
+        if (this.naturalHeight) {
+            this._naturalHeight = this.naturalHeight;
+        }
         
         if (this.initializing) {
             cameraProgress.removeClass('visible');