tesseract.js
Advanced tools
Comparing version 2.0.0-alpha.15 to 2.0.0-alpha.16
{ | ||
"name": "tesseract.js", | ||
"version": "2.0.0-alpha.15", | ||
"version": "2.0.0-alpha.16", | ||
"description": "Pure Javascript Multilingual OCR", | ||
"main": "src/index.js", | ||
"types": "types/index.d.ts", | ||
"unpkg": "dist/tesseract.min.js", | ||
@@ -57,6 +58,5 @@ "jsdelivr": "dist/tesseract.min.js", | ||
"is-url": "1.2.2", | ||
"node-fetch": "^2.3.0", | ||
"opencollective-postinstall": "^2.0.2", | ||
"resolve-url": "^0.2.1", | ||
"tesseract.js-core": "^2.0.0-beta.11", | ||
"tesseract.js-core": "^2.0.0-beta.12", | ||
"tesseract.js-utils": "^1.0.0-beta.8" | ||
@@ -63,0 +63,0 @@ }, |
@@ -57,3 +57,3 @@ <p align="center"> | ||
<!-- v2 --> | ||
<script src='https://unpkg.com/tesseract.js@v2.0.0-alpha.13/dist/tesseract.min.js'></script> | ||
<script src='https://unpkg.com/tesseract.js@v2.0.0-alpha.16/dist/tesseract.min.js'></script> | ||
@@ -60,0 +60,0 @@ <!-- v1 --> |
@@ -127,6 +127,7 @@ /** | ||
* @param {string} options.workerPath - worker script path | ||
* @param {boolean} options.workerBlobURL - Use a blob:// URL for the worker script | ||
*/ | ||
exports.spawnWorker = (instance, { workerPath }) => { | ||
exports.spawnWorker = (instance, { workerPath, workerBlobURL }) => { | ||
let worker; | ||
if (Blob && URL) { | ||
if (Blob && URL && workerBlobURL) { | ||
const blob = new Blob([`importScripts("${workerPath}");`], { | ||
@@ -133,0 +134,0 @@ type: 'application/javascript', |
@@ -11,2 +11,6 @@ const { OEM, PSM } = require('./types'); | ||
langPath: 'https://tessdata.projectnaptha.com/4.0.0', | ||
/* | ||
* Use BlobURL for worker script by default | ||
*/ | ||
workerBlobURL: true, | ||
}, | ||
@@ -13,0 +17,0 @@ /* |
@@ -35,2 +35,3 @@ /** | ||
* In Node.js environment, this option is not used as the worker script is in local. | ||
* @param {boolean} [options.workerBlobURL=true] - Use a blob: URL for the worker script | ||
* @param {string} options.corePath - | ||
@@ -37,0 +38,0 @@ * A remote path to load tesseract.js-core script. |
@@ -16,2 +16,4 @@ /** | ||
const isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined'; | ||
/* | ||
@@ -234,3 +236,3 @@ * Tesseract Module returned by TesseractCore. | ||
.catch((e) => { | ||
if (e instanceof DOMException) { | ||
if (isBrowser && e instanceof DOMException) { | ||
/* | ||
@@ -237,0 +239,0 @@ * For some reason google chrome throw DOMException in loadLang, |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1385533
7
45
2557
- Removednode-fetch@^2.3.0
- Removednode-fetch@2.7.0(transitive)
- Removedtr46@0.0.3(transitive)
- Removedwebidl-conversions@3.0.1(transitive)
- Removedwhatwg-url@5.0.0(transitive)