Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dynamsoft-label-recognizer

Package Overview
Dependencies
Maintainers
0
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dynamsoft-label-recognizer - npm Package Compare versions

Comparing version 3.2.30-beta-202405132039 to 3.2.30-iv-202407182011

4

dist/dlr.esm.js

@@ -7,6 +7,6 @@ /*!

* @author Dynamsoft
* @version 3.2.30-beta-202405132039
* @version 3.2.30-iv-202407182011
* @fileoverview Dynamsoft JavaScript Library for Barcode Reader
* More info on dlr JS: https://www.dynamsoft.com/label-recognition/docs/web/programming/javascript/
*/
import{engineResourcePaths as t,workerAutoResources as e,compareVersion as a,mapPackageRegister as r,innerVersions as s,loadWasm as c,getNextTaskID as o,mapTaskCallBack as n,CoreModule as l,worker as i}from"dynamsoft-core";const h="undefined"==typeof self,u=(()=>{if(!h&&document.currentScript){let t=document.currentScript.src,e=t.indexOf("?");if(-1!=e)t=t.substring(0,e);else{let e=t.indexOf("#");-1!=e&&(t=t.substring(0,e))}return t.substring(0,t.lastIndexOf("/")+1)}return"./"})(),d=t=>{if(null==t&&(t="./"),h);else{let e=document.createElement("a");e.href=t,t=e.href}return t.endsWith("/")||(t+="/"),t};null==t.dlr&&(t.dlr=u),null==t.dlrData&&(t.dlrData=d(u+"../../dynamsoft-label-recognizer-data@1.0.11/dist/")),e.dlr={js:!0,wasm:!0,deps:["license","dip","dnn"]},e.dnn={wasm:!0};const R="1.2.10";"string"!=typeof t.std&&a(t.std.version,R)<0&&(t.std={version:R,path:d(u+`../../dynamsoft-capture-vision-std@${R}/dist/`)});const p="2.2.30";(!t.dip||"string"!=typeof t.dip&&a(t.dip.version,p)<0)&&(t.dip={version:p,path:d(u+`../../dynamsoft-image-processing@${p}/dist/`)});const f="1.0.20";(!t.dnn||"string"!=typeof t.dnn&&a(t.dnn.version,f)<0)&&(t.dnn={version:f,path:d(u+`../../dynamsoft-capture-vision-dnn@${f}/dist/`)});let x=!1;class g{static getVersion(){const t=s.dlr&&s.dlr.wasm,e=s.dlr&&s.dlr.worker;return`3.2.30-beta-202405132039(Worker: ${e||"Not Loaded"}, Wasm: ${t||"Not Loaded"})`}static async loadRecognitionData(t,e){return await c("dlr"),await new Promise(((a,r)=>{let s=o();n[s]=async t=>{if(t.success){const e=t.result;if(0!==e.exception){let t=new Error(e.description);return t.errorCode=e.exception,r(t)}return e.bModel||(x=!0),a(e)}{let e=new Error(t.message);return e.stack=t.stack+"\n"+e.stack,r(e)}},e&&!e.endsWith("/")&&(e+="/"),e||"ConfusableChars"!==t||(e=l.engineResourcePaths.dlr);let c=l.engineResourcePaths.dlrData;l.engineResourcePaths.rootDirectory&&(c.startsWith("http://")||c.startsWith("https://")||(c=l.engineResourcePaths.rootDirectory+"/"+c)),l.engineResourcePaths.dlrData=d(c),i.postMessage({type:"dlr_loadData",id:s,body:{dataName:t,dataPath:e||l.engineResourcePaths.dlrData}})}))}}r.dlr={filterVINResult:function(t){let e="";if(18===t.characterResults.length){let e=t.characterResults[9].location.points[0].x-t.characterResults[8].location.points[1].x;e<2&&(e=2);let a=t.characterResults[1].location.points[0].x-t.characterResults[0].location.points[1].x,r=t.characterResults[17].location.points[0].x-t.characterResults[16].location.points[1].x,s=2===e?3:e;if(a-e>=s&&r-e<s)t.characterResults.shift();else if(r-e>=s&&a-e<s)t.characterResults.pop();else{t.characterResults[0].characterHConfidence>t.characterResults[17].characterHConfidence?t.characterResults.pop():t.characterResults.shift()}}else if(19===t.characterResults.length){let e=t.characterResults[10].location.points[0].x-t.characterResults[9].location.points[1].x;e<2&&(e=2);let a,r,s,c=t.characterResults[1].location.points[0].x-t.characterResults[0].location.points[1].x,o=t.characterResults[18].location.points[0].x-t.characterResults[17].location.points[1].x,n=t.characterResults[2].location.points[0].x-t.characterResults[1].location.points[1].x,l=t.characterResults[17].location.points[0].x-t.characterResults[16].location.points[1].x,i=2===e?3:e;if("1"===t.characterResults[1].characterH||"1"===t.characterResults[2].characterH||"1"===t.characterResults[16].characterH||"1"===t.characterResults[17].characterH){for(let e=9;e<t.characterResults.length;e++)if("1"!==t.characterResults[e].characterH){s=t.characterResults[e].location.points[1].x-t.characterResults[e].location.points[0].x;break}"1"===t.characterResults[1].characterH&&(a=s-(t.characterResults[1].location.points[1].x-t.characterResults[1].location.points[0].x)+3),"1"===t.characterResults[2].characterH&&(a=s-(t.characterResults[2].location.points[1].x-t.characterResults[2].location.points[0].x)+3),"1"===t.characterResults[16].characterH&&(r=s-(t.characterResults[16].location.points[1].x-t.characterResults[16].location.points[0].x)+3),"1"===t.characterResults[17].characterH&&(r=s-(t.characterResults[17].location.points[1].x-t.characterResults[17].location.points[0].x)+3)}if(n-e>=(a||i)&&l-e<(r||i))t.characterResults.splice(0,2);else if(l-e>=(r||i)&&n-e<(a||i))t.characterResults.splice(17,2);else if(c>e&&o>e)t.characterResults.pop(),t.characterResults.shift();else{let e=t.characterResults[0].characterHConfidence+t.characterResults[1].characterHConfidence,a=t.characterResults[17].characterHConfidence+t.characterResults[18].characterHConfidence,r=t.characterResults[0].characterHConfidence+t.characterResults[18].characterHConfidence,s=Math.min(e,a,r);s===e?t.characterResults.splice(0,2):s===a?t.characterResults.splice(17,2):s===r&&(t.characterResults.pop(),t.characterResults.shift())}}for(let a of t.characterResults)e+=a.characterH;return e},loadRecognitionData:g.loadRecognitionData,get bLoadConfusableCharsData(){return x}},n[-1]=async t=>{g.onDataLoadProgressChanged&&g.onDataLoadProgressChanged(t.resourcesPath,t.tag,{loaded:t.loaded,total:t.total})};export{g as LabelRecognizerModule};
import{engineResourcePaths as t,workerAutoResources as e,compareVersion as a,mapPackageRegister as r,innerVersions as s,loadWasm as c,getNextTaskID as o,mapTaskCallBack as n,CoreModule as l,worker as i}from"dynamsoft-core";const h="undefined"==typeof self,u=(()=>{if(!h&&document.currentScript){let t=document.currentScript.src,e=t.indexOf("?");if(-1!=e)t=t.substring(0,e);else{let e=t.indexOf("#");-1!=e&&(t=t.substring(0,e))}return t.substring(0,t.lastIndexOf("/")+1)}return"./"})(),d=t=>{if(null==t&&(t="./"),h);else{let e=document.createElement("a");e.href=t,t=e.href}return t.endsWith("/")||(t+="/"),t};null==t.dlr&&(t.dlr=u),null==t.dlrData&&(t.dlrData=d(u+"../../dynamsoft-label-recognizer-data@1.0.11/dist/")),e.dlr={js:!0,wasm:!0,deps:["license","dip","dnn"]},e.dnn={wasm:!0};const R="1.2.10";"string"!=typeof t.std&&a(t.std.version,R)<0&&(t.std={version:R,path:d(u+`../../dynamsoft-capture-vision-std@${R}/dist/`)});const p="2.2.30";(!t.dip||"string"!=typeof t.dip&&a(t.dip.version,p)<0)&&(t.dip={version:p,path:d(u+`../../dynamsoft-image-processing@${p}/dist/`)});const f="1.0.20";(!t.dnn||"string"!=typeof t.dnn&&a(t.dnn.version,f)<0)&&(t.dnn={version:f,path:d(u+`../../dynamsoft-capture-vision-dnn@${f}/dist/`)});let x=!1;class g{static getVersion(){const t=s.dlr&&s.dlr.wasm,e=s.dlr&&s.dlr.worker;return`3.2.30-iv-202407182011(Worker: ${e||"Not Loaded"}, Wasm: ${t||"Not Loaded"})`}static async loadRecognitionData(t,e){return await c("dlr"),await new Promise(((a,r)=>{let s=o();n[s]=async t=>{if(t.success){const e=t.result;if(0!==e.exception){let t=new Error(e.description);return t.errorCode=e.exception,r(t)}return e.bModel||(x=!0),a(e)}{let e=new Error(t.message);return e.stack=t.stack+"\n"+e.stack,r(e)}},e&&!e.endsWith("/")&&(e+="/"),e||"ConfusableChars"!==t||(e=l.engineResourcePaths.dlr);let c=l.engineResourcePaths.dlrData;l.engineResourcePaths.rootDirectory&&(c.startsWith("http://")||c.startsWith("https://")||(c=l.engineResourcePaths.rootDirectory+"/"+c)),l.engineResourcePaths.dlrData=d(c),i.postMessage({type:"dlr_loadData",id:s,body:{dataName:t,dataPath:e||l.engineResourcePaths.dlrData}})}))}}r.dlr={filterVINResult:function(t){let e="";if(18===t.characterResults.length){let e=t.characterResults[9].location.points[0].x-t.characterResults[8].location.points[1].x;e<2&&(e=2);let a=t.characterResults[1].location.points[0].x-t.characterResults[0].location.points[1].x,r=t.characterResults[17].location.points[0].x-t.characterResults[16].location.points[1].x,s=2===e?3:e;if(a-e>=s&&r-e<s)t.characterResults.shift();else if(r-e>=s&&a-e<s)t.characterResults.pop();else{t.characterResults[0].characterHConfidence>t.characterResults[17].characterHConfidence?t.characterResults.pop():t.characterResults.shift()}}else if(19===t.characterResults.length){let e=t.characterResults[10].location.points[0].x-t.characterResults[9].location.points[1].x;e<2&&(e=2);let a,r,s,c=t.characterResults[1].location.points[0].x-t.characterResults[0].location.points[1].x,o=t.characterResults[18].location.points[0].x-t.characterResults[17].location.points[1].x,n=t.characterResults[2].location.points[0].x-t.characterResults[1].location.points[1].x,l=t.characterResults[17].location.points[0].x-t.characterResults[16].location.points[1].x,i=2===e?3:e;if("1"===t.characterResults[1].characterH||"1"===t.characterResults[2].characterH||"1"===t.characterResults[16].characterH||"1"===t.characterResults[17].characterH){for(let e=9;e<t.characterResults.length;e++)if("1"!==t.characterResults[e].characterH){s=t.characterResults[e].location.points[1].x-t.characterResults[e].location.points[0].x;break}"1"===t.characterResults[1].characterH&&(a=s-(t.characterResults[1].location.points[1].x-t.characterResults[1].location.points[0].x)+3),"1"===t.characterResults[2].characterH&&(a=s-(t.characterResults[2].location.points[1].x-t.characterResults[2].location.points[0].x)+3),"1"===t.characterResults[16].characterH&&(r=s-(t.characterResults[16].location.points[1].x-t.characterResults[16].location.points[0].x)+3),"1"===t.characterResults[17].characterH&&(r=s-(t.characterResults[17].location.points[1].x-t.characterResults[17].location.points[0].x)+3)}if(n-e>=(a||i)&&l-e<(r||i))t.characterResults.splice(0,2);else if(l-e>=(r||i)&&n-e<(a||i))t.characterResults.splice(17,2);else if(c>e&&o>e)t.characterResults.pop(),t.characterResults.shift();else{let e=t.characterResults[0].characterHConfidence+t.characterResults[1].characterHConfidence,a=t.characterResults[17].characterHConfidence+t.characterResults[18].characterHConfidence,r=t.characterResults[0].characterHConfidence+t.characterResults[18].characterHConfidence,s=Math.min(e,a,r);s===e?t.characterResults.splice(0,2):s===a?t.characterResults.splice(17,2):s===r&&(t.characterResults.pop(),t.characterResults.shift())}}for(let a of t.characterResults)e+=a.characterH;return e},loadRecognitionData:g.loadRecognitionData,get bLoadConfusableCharsData(){return x}},n[-1]=async t=>{g.onDataLoadProgressChanged&&g.onDataLoadProgressChanged(t.resourcesPath,t.tag,{loaded:t.loaded,total:t.total})};export{g as LabelRecognizerModule};

@@ -7,6 +7,6 @@ /*!

* @author Dynamsoft
* @version 3.2.30-beta-202405132039
* @version 3.2.30-iv-202407182011
* @fileoverview Dynamsoft JavaScript Library for Barcode Reader
* More info on dlr JS: https://www.dynamsoft.com/label-recognition/docs/web/programming/javascript/
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("dynamsoft-core")):"function"==typeof define&&define.amd?define(["exports","dynamsoft-core"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).Dynamsoft=e.Dynamsoft||{},e.Dynamsoft.DLR={}),e.Dynamsoft.Core)}(this,(function(e,t){"use strict";const s="undefined"==typeof self,a=(()=>{if(!s&&document.currentScript){let e=document.currentScript.src,t=e.indexOf("?");if(-1!=t)e=e.substring(0,t);else{let t=e.indexOf("#");-1!=t&&(e=e.substring(0,t))}return e.substring(0,e.lastIndexOf("/")+1)}return"./"})(),r=e=>{if(null==e&&(e="./"),s);else{let t=document.createElement("a");t.href=e,e=t.href}return e.endsWith("/")||(e+="/"),e};null==t.engineResourcePaths.dlr&&(t.engineResourcePaths.dlr=a),null==t.engineResourcePaths.dlrData&&(t.engineResourcePaths.dlrData=r(a+"../../dynamsoft-label-recognizer-data@1.0.11/dist/")),t.workerAutoResources.dlr={js:!0,wasm:!0,deps:["license","dip","dnn"]},t.workerAutoResources.dnn={wasm:!0};const c="1.2.10";"string"!=typeof t.engineResourcePaths.std&&t.compareVersion(t.engineResourcePaths.std.version,c)<0&&(t.engineResourcePaths.std={version:c,path:r(a+`../../dynamsoft-capture-vision-std@${c}/dist/`)});const o="2.2.30";(!t.engineResourcePaths.dip||"string"!=typeof t.engineResourcePaths.dip&&t.compareVersion(t.engineResourcePaths.dip.version,o)<0)&&(t.engineResourcePaths.dip={version:o,path:r(a+`../../dynamsoft-image-processing@${o}/dist/`)});const n="1.0.20";(!t.engineResourcePaths.dnn||"string"!=typeof t.engineResourcePaths.dnn&&t.compareVersion(t.engineResourcePaths.dnn.version,n)<0)&&(t.engineResourcePaths.dnn={version:n,path:r(a+`../../dynamsoft-capture-vision-dnn@${n}/dist/`)});let i=!1;class l{static getVersion(){const e=t.innerVersions.dlr&&t.innerVersions.dlr.wasm,s=t.innerVersions.dlr&&t.innerVersions.dlr.worker;return`3.2.30-beta-202405132039(Worker: ${s||"Not Loaded"}, Wasm: ${e||"Not Loaded"})`}static async loadRecognitionData(e,s){return await t.loadWasm("dlr"),await new Promise(((a,c)=>{let o=t.getNextTaskID();t.mapTaskCallBack[o]=async e=>{if(e.success){const t=e.result;if(0!==t.exception){let e=new Error(t.description);return e.errorCode=t.exception,c(e)}return t.bModel||(i=!0),a(t)}{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,c(t)}},s&&!s.endsWith("/")&&(s+="/"),s||"ConfusableChars"!==e||(s=t.CoreModule.engineResourcePaths.dlr);let n=t.CoreModule.engineResourcePaths.dlrData;t.CoreModule.engineResourcePaths.rootDirectory&&(n.startsWith("http://")||n.startsWith("https://")||(n=t.CoreModule.engineResourcePaths.rootDirectory+"/"+n)),t.CoreModule.engineResourcePaths.dlrData=r(n),t.worker.postMessage({type:"dlr_loadData",id:o,body:{dataName:e,dataPath:s||t.CoreModule.engineResourcePaths.dlrData}})}))}}t.mapPackageRegister.dlr={filterVINResult:function(e){let t="";if(18===e.characterResults.length){let t=e.characterResults[9].location.points[0].x-e.characterResults[8].location.points[1].x;t<2&&(t=2);let s=e.characterResults[1].location.points[0].x-e.characterResults[0].location.points[1].x,a=e.characterResults[17].location.points[0].x-e.characterResults[16].location.points[1].x,r=2===t?3:t;if(s-t>=r&&a-t<r)e.characterResults.shift();else if(a-t>=r&&s-t<r)e.characterResults.pop();else{e.characterResults[0].characterHConfidence>e.characterResults[17].characterHConfidence?e.characterResults.pop():e.characterResults.shift()}}else if(19===e.characterResults.length){let t=e.characterResults[10].location.points[0].x-e.characterResults[9].location.points[1].x;t<2&&(t=2);let s,a,r,c=e.characterResults[1].location.points[0].x-e.characterResults[0].location.points[1].x,o=e.characterResults[18].location.points[0].x-e.characterResults[17].location.points[1].x,n=e.characterResults[2].location.points[0].x-e.characterResults[1].location.points[1].x,i=e.characterResults[17].location.points[0].x-e.characterResults[16].location.points[1].x,l=2===t?3:t;if("1"===e.characterResults[1].characterH||"1"===e.characterResults[2].characterH||"1"===e.characterResults[16].characterH||"1"===e.characterResults[17].characterH){for(let t=9;t<e.characterResults.length;t++)if("1"!==e.characterResults[t].characterH){r=e.characterResults[t].location.points[1].x-e.characterResults[t].location.points[0].x;break}"1"===e.characterResults[1].characterH&&(s=r-(e.characterResults[1].location.points[1].x-e.characterResults[1].location.points[0].x)+3),"1"===e.characterResults[2].characterH&&(s=r-(e.characterResults[2].location.points[1].x-e.characterResults[2].location.points[0].x)+3),"1"===e.characterResults[16].characterH&&(a=r-(e.characterResults[16].location.points[1].x-e.characterResults[16].location.points[0].x)+3),"1"===e.characterResults[17].characterH&&(a=r-(e.characterResults[17].location.points[1].x-e.characterResults[17].location.points[0].x)+3)}if(n-t>=(s||l)&&i-t<(a||l))e.characterResults.splice(0,2);else if(i-t>=(a||l)&&n-t<(s||l))e.characterResults.splice(17,2);else if(c>t&&o>t)e.characterResults.pop(),e.characterResults.shift();else{let t=e.characterResults[0].characterHConfidence+e.characterResults[1].characterHConfidence,s=e.characterResults[17].characterHConfidence+e.characterResults[18].characterHConfidence,a=e.characterResults[0].characterHConfidence+e.characterResults[18].characterHConfidence,r=Math.min(t,s,a);r===t?e.characterResults.splice(0,2):r===s?e.characterResults.splice(17,2):r===a&&(e.characterResults.pop(),e.characterResults.shift())}}for(let s of e.characterResults)t+=s.characterH;return t},loadRecognitionData:l.loadRecognitionData,get bLoadConfusableCharsData(){return i}},t.mapTaskCallBack[-1]=async e=>{l.onDataLoadProgressChanged&&l.onDataLoadProgressChanged(e.resourcesPath,e.tag,{loaded:e.loaded,total:e.total})},e.LabelRecognizerModule=l}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("dynamsoft-core")):"function"==typeof define&&define.amd?define(["exports","dynamsoft-core"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).Dynamsoft=e.Dynamsoft||{},e.Dynamsoft.DLR={}),e.Dynamsoft.Core)}(this,(function(e,t){"use strict";const s="undefined"==typeof self,a=(()=>{if(!s&&document.currentScript){let e=document.currentScript.src,t=e.indexOf("?");if(-1!=t)e=e.substring(0,t);else{let t=e.indexOf("#");-1!=t&&(e=e.substring(0,t))}return e.substring(0,e.lastIndexOf("/")+1)}return"./"})(),r=e=>{if(null==e&&(e="./"),s);else{let t=document.createElement("a");t.href=e,e=t.href}return e.endsWith("/")||(e+="/"),e};null==t.engineResourcePaths.dlr&&(t.engineResourcePaths.dlr=a),null==t.engineResourcePaths.dlrData&&(t.engineResourcePaths.dlrData=r(a+"../../dynamsoft-label-recognizer-data@1.0.11/dist/")),t.workerAutoResources.dlr={js:!0,wasm:!0,deps:["license","dip","dnn"]},t.workerAutoResources.dnn={wasm:!0};const c="1.2.10";"string"!=typeof t.engineResourcePaths.std&&t.compareVersion(t.engineResourcePaths.std.version,c)<0&&(t.engineResourcePaths.std={version:c,path:r(a+`../../dynamsoft-capture-vision-std@${c}/dist/`)});const o="2.2.30";(!t.engineResourcePaths.dip||"string"!=typeof t.engineResourcePaths.dip&&t.compareVersion(t.engineResourcePaths.dip.version,o)<0)&&(t.engineResourcePaths.dip={version:o,path:r(a+`../../dynamsoft-image-processing@${o}/dist/`)});const n="1.0.20";(!t.engineResourcePaths.dnn||"string"!=typeof t.engineResourcePaths.dnn&&t.compareVersion(t.engineResourcePaths.dnn.version,n)<0)&&(t.engineResourcePaths.dnn={version:n,path:r(a+`../../dynamsoft-capture-vision-dnn@${n}/dist/`)});let i=!1;class l{static getVersion(){const e=t.innerVersions.dlr&&t.innerVersions.dlr.wasm,s=t.innerVersions.dlr&&t.innerVersions.dlr.worker;return`3.2.30-iv-202407182011(Worker: ${s||"Not Loaded"}, Wasm: ${e||"Not Loaded"})`}static async loadRecognitionData(e,s){return await t.loadWasm("dlr"),await new Promise(((a,c)=>{let o=t.getNextTaskID();t.mapTaskCallBack[o]=async e=>{if(e.success){const t=e.result;if(0!==t.exception){let e=new Error(t.description);return e.errorCode=t.exception,c(e)}return t.bModel||(i=!0),a(t)}{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,c(t)}},s&&!s.endsWith("/")&&(s+="/"),s||"ConfusableChars"!==e||(s=t.CoreModule.engineResourcePaths.dlr);let n=t.CoreModule.engineResourcePaths.dlrData;t.CoreModule.engineResourcePaths.rootDirectory&&(n.startsWith("http://")||n.startsWith("https://")||(n=t.CoreModule.engineResourcePaths.rootDirectory+"/"+n)),t.CoreModule.engineResourcePaths.dlrData=r(n),t.worker.postMessage({type:"dlr_loadData",id:o,body:{dataName:e,dataPath:s||t.CoreModule.engineResourcePaths.dlrData}})}))}}t.mapPackageRegister.dlr={filterVINResult:function(e){let t="";if(18===e.characterResults.length){let t=e.characterResults[9].location.points[0].x-e.characterResults[8].location.points[1].x;t<2&&(t=2);let s=e.characterResults[1].location.points[0].x-e.characterResults[0].location.points[1].x,a=e.characterResults[17].location.points[0].x-e.characterResults[16].location.points[1].x,r=2===t?3:t;if(s-t>=r&&a-t<r)e.characterResults.shift();else if(a-t>=r&&s-t<r)e.characterResults.pop();else{e.characterResults[0].characterHConfidence>e.characterResults[17].characterHConfidence?e.characterResults.pop():e.characterResults.shift()}}else if(19===e.characterResults.length){let t=e.characterResults[10].location.points[0].x-e.characterResults[9].location.points[1].x;t<2&&(t=2);let s,a,r,c=e.characterResults[1].location.points[0].x-e.characterResults[0].location.points[1].x,o=e.characterResults[18].location.points[0].x-e.characterResults[17].location.points[1].x,n=e.characterResults[2].location.points[0].x-e.characterResults[1].location.points[1].x,i=e.characterResults[17].location.points[0].x-e.characterResults[16].location.points[1].x,l=2===t?3:t;if("1"===e.characterResults[1].characterH||"1"===e.characterResults[2].characterH||"1"===e.characterResults[16].characterH||"1"===e.characterResults[17].characterH){for(let t=9;t<e.characterResults.length;t++)if("1"!==e.characterResults[t].characterH){r=e.characterResults[t].location.points[1].x-e.characterResults[t].location.points[0].x;break}"1"===e.characterResults[1].characterH&&(s=r-(e.characterResults[1].location.points[1].x-e.characterResults[1].location.points[0].x)+3),"1"===e.characterResults[2].characterH&&(s=r-(e.characterResults[2].location.points[1].x-e.characterResults[2].location.points[0].x)+3),"1"===e.characterResults[16].characterH&&(a=r-(e.characterResults[16].location.points[1].x-e.characterResults[16].location.points[0].x)+3),"1"===e.characterResults[17].characterH&&(a=r-(e.characterResults[17].location.points[1].x-e.characterResults[17].location.points[0].x)+3)}if(n-t>=(s||l)&&i-t<(a||l))e.characterResults.splice(0,2);else if(i-t>=(a||l)&&n-t<(s||l))e.characterResults.splice(17,2);else if(c>t&&o>t)e.characterResults.pop(),e.characterResults.shift();else{let t=e.characterResults[0].characterHConfidence+e.characterResults[1].characterHConfidence,s=e.characterResults[17].characterHConfidence+e.characterResults[18].characterHConfidence,a=e.characterResults[0].characterHConfidence+e.characterResults[18].characterHConfidence,r=Math.min(t,s,a);r===t?e.characterResults.splice(0,2):r===s?e.characterResults.splice(17,2):r===a&&(e.characterResults.pop(),e.characterResults.shift())}}for(let s of e.characterResults)t+=s.characterH;return t},loadRecognitionData:l.loadRecognitionData,get bLoadConfusableCharsData(){return i}},t.mapTaskCallBack[-1]=async e=>{l.onDataLoadProgressChanged&&l.onDataLoadProgressChanged(e.resourcesPath,e.tag,{loaded:e.loaded,total:e.total})},e.LabelRecognizerModule=l}));

@@ -7,6 +7,6 @@ /*!

* @author Dynamsoft
* @version 3.2.30-beta-202405132039
* @version 3.2.30-iv-202407182011
* @fileoverview Dynamsoft JavaScript Library for Barcode Reader
* More info on dlr JS: https://www.dynamsoft.com/label-recognition/docs/web/programming/javascript/
*/
!function(){"use strict";let e={};const t=self;t.dlrWorkerVersion="3.2.30-beta-202405132039";const a=t.checkAndAutoLoadCaffeModel=async(t,a)=>{if(!e[t]){let r={Letter:2711347,Number:2626880,NumberLetter:2733480,NumberUppercase:2679209,Uppercase:2659096,MRZ:2681184,VIN:2679232}[t];e[t]=(async()=>{try{let s,o,n;const d=new TextDecoder,l=a+t+".data",c=await new Promise(((e,s)=>{const o=new XMLHttpRequest;o.responseType="arraybuffer",o.onload=()=>{o.status<200||o.status>=300?e({ok:!1,status:o.status}):e({ok:!0,arrayBuffer:()=>o.response})},o.onerror=o.onabort=()=>{s({ok:!1,status:o.status})},o.onloadstart=()=>{postMessage({type:"event",id:-1,body:{loaded:0,total:r||0,tag:"starting",resourcesPath:a+t+".data"}})},o.onloadend=()=>{postMessage({type:"event",id:-1,body:{loaded:r||0,total:r||0,tag:"completed",resourcesPath:a+t+".data"}})};let n=Date.now();o.onprogress=e=>{if(e.lengthComputable&&(r=e.total),r){const t=Date.now();n+500<t&&(postMessage({type:"event",id:-1,body:{total:r,loaded:e.loaded,tag:"in progress",resourcesPath:l}}),n=t)}},o.open("GET",l,!0),o.send()}));if(!c.ok)throw new Error(`Network error. ${l} Status: ${c.status}.`);s=await c.arrayBuffer();const i=d.decode(new Uint8Array(s,0,8));if("DLR_MDL "===i){{let e=0;const t=new Uint8Array(s,8,8);for(let a=7;a>=0;--a)e=256*e+t[a];const a=d.decode(new Uint8Array(s,16,e));o=JSON.parse(a),n=16+e}let a=e=>{const t=o[e];if(!t)throw new Error(`File name '${e}' not found.`);return new Uint8Array(s,n+t[0],t[1])},r=JSON.parse(d.decode(a(t+".config.json")));const l=r.mainModel,c=r.assistModels,i=r.modelFilter;{const e=a(l+".prototxt"),r=a(l+".txt"),s=a(l+".caffemodel");ep(),wasmImports.emscripten_bind_DlrWasm_appendCaffeModelBuffer_7(es(t),setBufferIntoWasm(e,0),e.length,setBufferIntoWasm(r,1),r.length,setBufferIntoWasm(s,2),s.length)}if(c)for(let e of c){const r=t+e,s=l+e,o=a(s+".prototxt"),n=a(s+".txt"),d=a(s+".caffemodel");wasmImports.emscripten_bind_DlrWasm_appendCaffeModelBuffer_7(r,o,o.length,n,n.length,d,d.length)}if(i){const e=a(i+".txt");wasmImports.emscripten_bind_DlrWasm_appendModelFilterFileBuffer_3(t,e,e.length)}e[t]=Promise.resolve({exception:0,description:"Successful.",bModel:!0})}else{if("CDLR_MDL"!==i)throw new Error("Model data type incorrect.");{const a=new Uint8Array(s),r=[68,76,82,95,77,68,76,32];for(let e=0;e<8;e++)a[e]=r[e];let o=t;t.endsWith(".data")||(o+=".data"),ep();let n=JSON.parse(UTF8ToString(wasmImports.emscripten_bind_DlrWasm_AppendConfusableCharactersBuffer_3(es(o),setBufferIntoWasm(a,0),a.length)));e[t]=n}}return e[t]}catch(a){throw delete e[t],a}})()}await e[t]};Object.assign(mapController,{dlr_loadData:async(t,r)=>{try{await a(t.dataName,t.dataPath);let s=await e[t.dataName];handleTaskRes(r,{success:!0,result:s})}catch(e){return void handleTaskErr(r,e)}}})}();
!function(){"use strict";let e={};const t=self;t.dlrWorkerVersion="3.2.30-iv-202407182011";const a=t.checkAndAutoLoadCaffeModel=async(t,a)=>{if(!e[t]){let r={Letter:2711347,Number:2626880,NumberLetter:2733480,NumberUppercase:2679209,Uppercase:2659096,MRZ:2681184,VIN:2679232}[t];e[t]=(async()=>{try{let s,o,n;const d=new TextDecoder,l=a+t+".data",c=await new Promise(((e,s)=>{const o=new XMLHttpRequest;o.responseType="arraybuffer",o.onload=()=>{o.status<200||o.status>=300?e({ok:!1,status:o.status}):e({ok:!0,arrayBuffer:()=>o.response})},o.onerror=o.onabort=()=>{s({ok:!1,status:o.status})},o.onloadstart=()=>{postMessage({type:"event",id:-1,body:{loaded:0,total:r||0,tag:"starting",resourcesPath:a+t+".data"}})},o.onloadend=()=>{postMessage({type:"event",id:-1,body:{loaded:r||0,total:r||0,tag:"completed",resourcesPath:a+t+".data"}})};let n=Date.now();o.onprogress=e=>{if(e.lengthComputable&&(r=e.total),r){const t=Date.now();n+500<t&&(postMessage({type:"event",id:-1,body:{total:r,loaded:e.loaded,tag:"in progress",resourcesPath:l}}),n=t)}},o.open("GET",l,!0),o.send()}));if(!c.ok)throw new Error(`Network error. ${l} Status: ${c.status}.`);s=await c.arrayBuffer();const i=d.decode(new Uint8Array(s,0,8));if("DLR_MDL "===i){{let e=0;const t=new Uint8Array(s,8,8);for(let a=7;a>=0;--a)e=256*e+t[a];const a=d.decode(new Uint8Array(s,16,e));o=JSON.parse(a),n=16+e}let a=e=>{const t=o[e];if(!t)throw new Error(`File name '${e}' not found.`);return new Uint8Array(s,n+t[0],t[1])},r=JSON.parse(d.decode(a(t+".config.json")));const l=r.mainModel,c=r.assistModels,i=r.modelFilter;{const e=a(l+".prototxt"),r=a(l+".txt"),s=a(l+".caffemodel");ep(),wasmImports.emscripten_bind_DlrWasm_appendCaffeModelBuffer_7(es(t),setBufferIntoWasm(e,0),e.length,setBufferIntoWasm(r,1),r.length,setBufferIntoWasm(s,2),s.length)}if(c)for(let e of c){const r=t+e,s=l+e,o=a(s+".prototxt"),n=a(s+".txt"),d=a(s+".caffemodel");wasmImports.emscripten_bind_DlrWasm_appendCaffeModelBuffer_7(r,o,o.length,n,n.length,d,d.length)}if(i){const e=a(i+".txt");wasmImports.emscripten_bind_DlrWasm_appendModelFilterFileBuffer_3(t,e,e.length)}e[t]=Promise.resolve({exception:0,description:"Successful.",bModel:!0})}else{if("CDLR_MDL"!==i)throw new Error("Model data type incorrect.");{const a=new Uint8Array(s),r=[68,76,82,95,77,68,76,32];for(let e=0;e<8;e++)a[e]=r[e];let o=t;t.endsWith(".data")||(o+=".data"),ep();let n=JSON.parse(UTF8ToString(wasmImports.emscripten_bind_DlrWasm_AppendConfusableCharactersBuffer_3(es(o),setBufferIntoWasm(a,0),a.length)));e[t]=n}}return e[t]}catch(a){throw delete e[t],a}})()}await e[t]};Object.assign(mapController,{dlr_loadData:async(t,r)=>{try{await a(t.dataName,t.dataPath);let s=await e[t.dataName];handleTaskRes(r,{success:!0,result:s})}catch(e){return void handleTaskErr(r,e)}}})}();
{
"name": "dynamsoft-label-recognizer",
"version": "3.2.30-beta-202405132039",
"version": "3.2.30-iv-202407182011",
"description": "Dynamsoft Label Recognizer (DLR) is an SDK designed to recognize meaningful zonal text or symbols in an image (Label). Common scenarios include price tags in supermarkets, inventory labels in warehouses, VIN codes on car windshields, driver licenses, passports, visas, ID cards, etc.",

@@ -40,3 +40,3 @@ "files": [

"registry": "https://registry.npmjs.org/",
"tag": "beta"
"tag": "iv"
},

@@ -43,0 +43,0 @@ "license": "SEE LICENSE IN LICENSE",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc