Browse Source

Replace langPath from jsDelivr to Github Page as there is 20MB limitation

pull/267/head
Jerome Wu 6 years ago
parent
commit
8e1b21cd2c
  1. 4
      README.md
  2. 2
      dist/tesseract.js
  3. 2
      dist/tesseract.min.js
  4. 2
      dist/tesseract.min.js.map
  5. 3
      dist/worker.js
  6. 2
      dist/worker.min.js
  7. 2
      dist/worker.min.js.map
  8. 28
      package-lock.json
  9. 2
      src/browser/index.js
  10. 2
      src/node/index.js

4
README.md

@ -30,7 +30,7 @@ Tesseract.js works with a `<script>` tag via local copy or CDN, with webpack and @@ -30,7 +30,7 @@ Tesseract.js works with a `<script>` tag via local copy or CDN, with webpack and
You can simply include Tesseract.js with a CDN like this:
```html
<script src='https://cdnjs.cloudflare.com/ajax/libs/tesseract.js/1.0.13/tesseract.min.js'></script>
<script src='https://cdn.jsdelivr.net/gh/naptha/tesseract.js@v1.0.14/dist/tesseract.min.js'></script>
```
After including your scripts, the `Tesseract` variable will be defined globally!
@ -251,7 +251,7 @@ Because of this we recommend loading `tesseract.js` from a CDN. But if you reall @@ -251,7 +251,7 @@ Because of this we recommend loading `tesseract.js` from a CDN. But if you reall
```javascript
window.Tesseract = Tesseract.create({
workerPath: '/path/to/worker.js',
langPath: 'https://cdn.jsdelivr.net/gh/naptha/tessdata@gh-pages/3.02/',
langPath: 'https://tessdata.projectnaptha.com/3.02/',
corePath: 'https://cdn.jsdelivr.net/gh/naptha/tesseract.js-core@0.1.0/index.js',
})
```

2
dist/tesseract.js vendored

@ -239,7 +239,7 @@ module.exports={ @@ -239,7 +239,7 @@ module.exports={
var defaultOptions = {
// workerPath: 'https://cdn.jsdelivr.net/gh/naptha/tesseract.js@0.2.0/dist/worker.js',
corePath: 'https://cdn.jsdelivr.net/gh/naptha/tesseract.js-core@0.1.0/index.js',
langPath: 'https://cdn.jsdelivr.net/gh/naptha/tessdata@gh-pages/3.02/'
langPath: 'https://tessdata.projectnaptha.com/3.02/'
};
if (process.env.NODE_ENV === "development") {

2
dist/tesseract.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/tesseract.min.js.map vendored

File diff suppressed because one or more lines are too long

3
dist/worker.js vendored

@ -8915,6 +8915,9 @@ function dispatchHandlers(packet, send) { @@ -8915,6 +8915,9 @@ function dispatchHandlers(packet, send) {
handleDetect(packet.payload, respond);
}
} catch (err) {
// Prepare exception to travel through postMessage
err = err.toString();
respond.reject(err);
}
}

2
dist/worker.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/worker.min.js.map vendored

File diff suppressed because one or more lines are too long

28
package-lock.json generated

@ -1587,12 +1587,14 @@ @@ -1587,12 +1587,14 @@
"balanced-match": {
"version": "1.0.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@ -1607,17 +1609,20 @@ @@ -1607,17 +1609,20 @@
"code-point-at": {
"version": "1.1.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"concat-map": {
"version": "0.0.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"core-util-is": {
"version": "1.0.2",
@ -1734,7 +1739,8 @@ @@ -1734,7 +1739,8 @@
"inherits": {
"version": "2.0.3",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"ini": {
"version": "1.3.5",
@ -1746,6 +1752,7 @@ @@ -1746,6 +1752,7 @@
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
@ -1760,6 +1767,7 @@ @@ -1760,6 +1767,7 @@
"version": "3.0.4",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
@ -1767,12 +1775,14 @@ @@ -1767,12 +1775,14 @@
"minimist": {
"version": "0.0.8",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"minipass": {
"version": "2.2.4",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.1",
"yallist": "^3.0.0"
@ -1791,6 +1801,7 @@ @@ -1791,6 +1801,7 @@
"version": "0.5.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"minimist": "0.0.8"
}
@ -1871,7 +1882,8 @@ @@ -1871,7 +1882,8 @@
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"object-assign": {
"version": "4.1.1",
@ -1883,6 +1895,7 @@ @@ -1883,6 +1895,7 @@
"version": "1.4.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"wrappy": "1"
}
@ -2004,6 +2017,7 @@ @@ -2004,6 +2017,7 @@
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",

2
src/browser/index.js

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
var defaultOptions = {
// workerPath: 'https://cdn.jsdelivr.net/gh/naptha/tesseract.js@0.2.0/dist/worker.js',
corePath: 'https://cdn.jsdelivr.net/gh/naptha/tesseract.js-core@0.1.0/index.js',
langPath: 'https://cdn.jsdelivr.net/gh/naptha/tessdata@gh-pages/3.02/',
langPath: 'https://tessdata.projectnaptha.com/3.02/',
}
if (process.env.NODE_ENV === "development") {

2
src/node/index.js

@ -5,7 +5,7 @@ const fetch = require('isomorphic-fetch'), @@ -5,7 +5,7 @@ const fetch = require('isomorphic-fetch'),
exports.defaultOptions = {
workerPath: require('path').join(__dirname, 'worker.js'),
langPath: 'https://cdn.jsdelivr.net/gh/naptha/tessdata@gh-pages/3.02/',
langPath: 'https://tessdata.projectnaptha.com/3.02/',
}
exports.spawnWorker = function spawnWorker(instance, workerOptions){

Loading…
Cancel
Save