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
You can simply include Tesseract.js with a CDN like this: You can simply include Tesseract.js with a CDN like this:
```html ```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! 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
```javascript ```javascript
window.Tesseract = Tesseract.create({ window.Tesseract = Tesseract.create({
workerPath: '/path/to/worker.js', 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', 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={
var defaultOptions = { var defaultOptions = {
// workerPath: 'https://cdn.jsdelivr.net/gh/naptha/tesseract.js@0.2.0/dist/worker.js', // 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', 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") { 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) {
handleDetect(packet.payload, respond); handleDetect(packet.payload, respond);
} }
} catch (err) { } catch (err) {
// Prepare exception to travel through postMessage
err = err.toString();
respond.reject(err); 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 @@
"balanced-match": { "balanced-match": {
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"brace-expansion": { "brace-expansion": {
"version": "1.1.11", "version": "1.1.11",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"balanced-match": "^1.0.0", "balanced-match": "^1.0.0",
"concat-map": "0.0.1" "concat-map": "0.0.1"
@ -1607,17 +1609,20 @@
"code-point-at": { "code-point-at": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"concat-map": { "concat-map": {
"version": "0.0.1", "version": "0.0.1",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"console-control-strings": { "console-control-strings": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"core-util-is": { "core-util-is": {
"version": "1.0.2", "version": "1.0.2",
@ -1734,7 +1739,8 @@
"inherits": { "inherits": {
"version": "2.0.3", "version": "2.0.3",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"ini": { "ini": {
"version": "1.3.5", "version": "1.3.5",
@ -1746,6 +1752,7 @@
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"number-is-nan": "^1.0.0" "number-is-nan": "^1.0.0"
} }
@ -1760,6 +1767,7 @@
"version": "3.0.4", "version": "3.0.4",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"brace-expansion": "^1.1.7" "brace-expansion": "^1.1.7"
} }
@ -1767,12 +1775,14 @@
"minimist": { "minimist": {
"version": "0.0.8", "version": "0.0.8",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"minipass": { "minipass": {
"version": "2.2.4", "version": "2.2.4",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"safe-buffer": "^5.1.1", "safe-buffer": "^5.1.1",
"yallist": "^3.0.0" "yallist": "^3.0.0"
@ -1791,6 +1801,7 @@
"version": "0.5.1", "version": "0.5.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"minimist": "0.0.8" "minimist": "0.0.8"
} }
@ -1871,7 +1882,8 @@
"number-is-nan": { "number-is-nan": {
"version": "1.0.1", "version": "1.0.1",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"object-assign": { "object-assign": {
"version": "4.1.1", "version": "4.1.1",
@ -1883,6 +1895,7 @@
"version": "1.4.0", "version": "1.4.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"wrappy": "1" "wrappy": "1"
} }
@ -2004,6 +2017,7 @@
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"code-point-at": "^1.0.0", "code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0", "is-fullwidth-code-point": "^1.0.0",

2
src/browser/index.js

@ -1,7 +1,7 @@
var defaultOptions = { var defaultOptions = {
// workerPath: 'https://cdn.jsdelivr.net/gh/naptha/tesseract.js@0.2.0/dist/worker.js', // 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', 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") { if (process.env.NODE_ENV === "development") {

2
src/node/index.js

@ -5,7 +5,7 @@ const fetch = require('isomorphic-fetch'),
exports.defaultOptions = { exports.defaultOptions = {
workerPath: require('path').join(__dirname, 'worker.js'), 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){ exports.spawnWorker = function spawnWorker(instance, workerOptions){

Loading…
Cancel
Save