From: Calin Crisan Date: Sun, 13 Nov 2016 17:05:27 +0000 (+0200) Subject: fixed mask editing when no streaming resolution is available X-Git-Url: http://www.vanbest.org/gitweb/?a=commitdiff_plain;h=cb5050d0288135fecf8cd26a31ad0a8046f30cec;p=motioneye-debian fixed mask editing when no streaming resolution is available --- diff --git a/motioneye/static/js/main.js b/motioneye/static/js/main.js index 134e7af..e551f62 100644 --- a/motioneye/static/js/main.js +++ b/motioneye/static/js/main.js @@ -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');