From f3e0a48471a787cfb5dd07595ac644071c43934c Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Sun, 10 Mar 2019 23:35:13 +0100 Subject: [PATCH] Automatic detection fix --- src/ext/lib/ar-detect/ArDetector.js | 8 ++++---- src/ext/lib/ar-detect/edge-detect/EdgeDetect.js | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/ext/lib/ar-detect/ArDetector.js b/src/ext/lib/ar-detect/ArDetector.js index f7dcf9d..8f2f059 100644 --- a/src/ext/lib/ar-detect/ArDetector.js +++ b/src/ext/lib/ar-detect/ArDetector.js @@ -476,7 +476,7 @@ class ArDetector { // poglejmo, če se je razmerje stranic spremenilo // check if aspect ratio is changed: var lastAr = this.conf.resizer.getLastAr(); - if( lastAr.type === AspectRatio.Automatic && lastAr.ar != null){ + if( lastAr.type === AspectRatio.Automatic && lastAr.ratio !== null){ // spremembo lahko zavrnemo samo, če uporabljamo avtomatski način delovanja in če smo razmerje stranic // že nastavili. // @@ -600,7 +600,7 @@ class ArDetector { // If we don't detect letterbox, we reset aspect ratio to aspect ratio of the video file. The aspect ratio could // have been corrected manually. It's also possible that letterbox (that was there before) disappeared. console.log("FAST LETTERBOX PRESENCE TEST FAILED, CALLING RESET") - this.conf.resizer.reset({type: AspectRatio.Automatic, ar: null}); + this.conf.resizer.reset({type: AspectRatio.Automatic, ratio: null}); this.guardLine.reset(); this.noLetterboxCanvasReset = true; @@ -639,7 +639,7 @@ class ArDetector { // (since the new letterbox edge isn't present in our sample due to technical // limitations) if (this.fallbackMode && guardLineOut.blackbarFail) { - this.conf.resizer.reset({type: AspectRatio.Automatic, ar: null}); + this.conf.resizer.reset({type: AspectRatio.Automatic, ratio: null}); this.guardLine.reset(); this.noLetterboxCanvasReset = true; @@ -665,7 +665,7 @@ class ArDetector { } if(guardLineOut.blackbarFail){ - this.conf.resizer.reset({type: AspectRatio.Automatic, ar: null}); + this.conf.resizer.reset({type: AspectRatio.Automatic, ratio: null}); this.guardLine.reset(); } diff --git a/src/ext/lib/ar-detect/edge-detect/EdgeDetect.js b/src/ext/lib/ar-detect/edge-detect/EdgeDetect.js index 89c1c3c..67c08bb 100644 --- a/src/ext/lib/ar-detect/edge-detect/EdgeDetect.js +++ b/src/ext/lib/ar-detect/edge-detect/EdgeDetect.js @@ -2,6 +2,7 @@ import Debug from '../../../conf/Debug'; import EdgeStatus from './enums/EdgeStatusEnum'; import EdgeDetectQuality from './enums/EdgeDetectQualityEnum'; import EdgeDetectPrimaryDirection from './enums/EdgeDetectPrimaryDirectionEnum'; +import AntiGradientMode from '../../../../common/enums/anti-gradient-mode.enum'; if (Debug.debug) { console.log("Loading EdgeDetect.js"); @@ -30,7 +31,7 @@ class EdgeDetect{ var fastCandidates, edgeCandidates, bars; if (direction == EdgeDetectPrimaryDirection.VERTICAL) { fastCandidates = this.findCandidates(image, sampleCols, guardLineOut); - + // if(quality == EdgeDetectQuality.FAST){ // edges = fastCandidates; // todo: processing // } else {