scribe.js-ocr 0.7.2 → 0.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/cli/cli.js +12 -1
  2. package/cli/detectPDFType.js +13 -20
  3. package/cli/extract.js +4 -2
  4. package/cli/scribe.js +9 -1
  5. package/fonts/all/Carlito-BoldItalic.woff +0 -0
  6. package/fonts/all/Century-BoldItalic.woff +0 -0
  7. package/fonts/all/Garamond-BoldItalic.woff +0 -0
  8. package/fonts/all/NimbusMono-BoldItalic.woff +0 -0
  9. package/fonts/all/NimbusRoman-BoldItalic.woff +0 -0
  10. package/fonts/all/NimbusSans-BoldItalic.woff +0 -0
  11. package/fonts/all/Palatino-BoldItalic.woff +0 -0
  12. package/fonts/latin/Carlito-BoldItalic.woff +0 -0
  13. package/fonts/latin/Century-BoldItalic.woff +0 -0
  14. package/fonts/latin/Garamond-BoldItalic.woff +0 -0
  15. package/fonts/latin/NimbusMono-BoldItalic.woff +0 -0
  16. package/fonts/latin/NimbusRoman-BoldItalic.woff +0 -0
  17. package/fonts/latin/NimbusSans-BoldItalic.woff +0 -0
  18. package/fonts/latin/Palatino-BoldItalic.woff +0 -0
  19. package/js/containers/app.js +1 -1
  20. package/js/containers/fontContainer.js +42 -40
  21. package/js/export/export.js +1 -1
  22. package/js/export/writeHocr.js +15 -13
  23. package/js/export/writeHtml.js +45 -29
  24. package/js/export/writePdf.js +52 -14
  25. package/js/export/writePdfFonts.js +11 -9
  26. package/js/export/writeTabular.js +2 -2
  27. package/js/export/writeText.js +10 -6
  28. package/js/extractTables.js +5 -5
  29. package/js/fontContainerMain.js +50 -7
  30. package/js/fontStatistics.js +18 -13
  31. package/js/fontSupp.js +20 -20
  32. package/js/global.d.ts +17 -0
  33. package/js/import/convertPageAbbyy.js +47 -25
  34. package/js/import/convertPageBlocks.js +2 -2
  35. package/js/import/convertPageHocr.js +10 -20
  36. package/js/import/convertPageShared.js +13 -9
  37. package/js/import/convertPageStext.js +66 -31
  38. package/js/objects/ocrObjects.js +13 -19
  39. package/js/utils/fontUtils.js +11 -11
  40. package/js/utils/miscUtils.js +16 -0
  41. package/js/worker/compareOCRModule.js +13 -16
  42. package/js/worker/optimizeFontModule.js +4 -4
  43. package/mupdf/libmupdf.js +123 -17
  44. package/mupdf/libmupdf.wasm +0 -0
  45. package/package.json +1 -1
@@ -101,7 +101,7 @@ function calcWordFontSizePrecise(wordArr, fontOpentype, nonLatin = false) {
101
101
  * @returns {Array<string>}
102
102
  */
103
103
  export function addLigatures(word) {
104
- if (word.smallCaps || !opt.ligatures) return word.text.split('');
104
+ if (word.style.smallCaps || !opt.ligatures) return word.text.split('');
105
105
  const fontI = FontCont.getWordFont(word);
106
106
  const fontOpentype = fontI.opentype;
107
107
  return addLigaturesText(word.text, fontOpentype);
@@ -220,11 +220,11 @@ export function calcWordMetrics(word, angle = 0) {
220
220
 
221
221
  const charArr = addLigatures(word);
222
222
 
223
- const charArr2 = word.smallCaps ? charArr.map((x) => (x.toUpperCase())) : charArr;
223
+ const charArr2 = word.style.smallCaps ? charArr.map((x) => (x.toUpperCase())) : charArr;
224
224
 
225
225
  const { advanceArr, kerningArr } = calcWordCharMetrics(charArr2, fontOpentype);
226
226
 
227
- if (word.smallCaps) {
227
+ if (word.style.smallCaps) {
228
228
  for (let i = 0; i < charArr2.length; i++) {
229
229
  if (charArr2[i] !== charArr[i]) {
230
230
  advanceArr[i] *= fontI.smallCapsMult;
@@ -244,10 +244,10 @@ export function calcWordMetrics(word, angle = 0) {
244
244
  // The `leftSideBearing`/`rightSideBearing`/ numbers reported by Opentype.js are not accurate for mono-spaced fonts, so `xMin`/`xMax` are used instead.
245
245
  let wordLeftBearing = wordFirstGlyphMetrics.xMin || 0;
246
246
  let lastGlyphMax = wordLastGlyphMetrics.xMax || 0;
247
- if (word.smallCaps && charArr2[charArr2.length - 1] !== charArr[charArr2.length - 1]) lastGlyphMax *= fontI.smallCapsMult;
247
+ if (word.style.smallCaps && charArr2[charArr2.length - 1] !== charArr[charArr2.length - 1]) lastGlyphMax *= fontI.smallCapsMult;
248
248
  let wordRightBearing = advanceArr[advanceArr.length - 1] - lastGlyphMax;
249
- if (word.smallCaps && charArr2[0] !== charArr[0]) wordLeftBearing *= fontI.smallCapsMult;
250
- if (word.smallCaps && charArr2[charArr2.length - 1] !== charArr[charArr2.length - 1]) wordRightBearing *= fontI.smallCapsMult;
249
+ if (word.style.smallCaps && charArr2[0] !== charArr[0]) wordLeftBearing *= fontI.smallCapsMult;
250
+ if (word.style.smallCaps && charArr2[charArr2.length - 1] !== charArr[charArr2.length - 1]) wordRightBearing *= fontI.smallCapsMult;
251
251
 
252
252
  const wordWidth = word.visualCoords ? wordWidth1 - wordRightBearing - wordLeftBearing : wordWidth1;
253
253
  const wordWidthPx = wordWidth * (fontSize / fontOpentype.unitsPerEm);
@@ -293,22 +293,22 @@ export const calcWordFontSize = (word) => {
293
293
  // If the word is a superscript or dropcap, then size is calculated dynamically for the word.
294
294
  // The size of these characters are currently not editable by the user.
295
295
  // This is because `size` is currently treated as the size of the main text, and does not vary between main text and superscripts.
296
- if (word.sup || word.dropcap) {
296
+ if (word.style.sup || word.style.dropcap) {
297
297
  if (word.visualCoords) {
298
298
  return getFontSize(fontOpentype, word.bbox.bottom - word.bbox.top, word.text);
299
299
  }
300
- if (word.size) {
300
+ if (word.style.size) {
301
301
  const mult = FontProps.sizeMult[font.family] || 1;
302
- return word.size / mult;
302
+ return word.style.size / mult;
303
303
  }
304
304
 
305
305
  return (word.bbox.bottom - word.bbox.top) * (fontOpentype.unitsPerEm / (fontOpentype.ascender - fontOpentype.descender));
306
306
  }
307
307
 
308
308
  // If the user manually set a size, then use that
309
- if (word.size) {
309
+ if (word.style.size) {
310
310
  const mult = FontProps.sizeMult[font.family] || 1;
311
- return word.size / mult;
311
+ return word.style.size / mult;
312
312
  }
313
313
  const lineFontSize = calcLineFontSize(word.line);
314
314
 
@@ -490,3 +490,19 @@ export function range(min, max) {
490
490
  export const debugLog = (x) => new Promise((resolve) => {
491
491
  process.stderr.write(`${String(x)}\n`, resolve);
492
492
  });
493
+
494
+ /**
495
+ *
496
+ * @param {Partial<Style>} style
497
+ */
498
+ export const getStyleLookup = (style) => {
499
+ let styleStr = 'normal';
500
+ if (style.bold && style.italic) {
501
+ styleStr = 'boldItalic';
502
+ } else if (style.bold) {
503
+ styleStr = 'bold';
504
+ } else if (style.italic) {
505
+ styleStr = 'italic';
506
+ }
507
+ return styleStr;
508
+ };
@@ -141,7 +141,7 @@ export const drawWordRender = async (ctx, word, offsetX = 0, cropY = 0, ctxView
141
141
  const charSpacing = wordMetrics.charSpacing;
142
142
  const wordFontSize = wordMetrics.fontSize;
143
143
 
144
- if (word.sup) {
144
+ if (word.style.sup) {
145
145
  const wordboxXMid = word.bbox.left + (word.bbox.right - word.bbox.left) / 2;
146
146
 
147
147
  const baselineYWord = word.line.bbox.bottom + word.line.baseline[1] + word.line.baseline[0] * (wordboxXMid - word.line.bbox.left);
@@ -173,12 +173,12 @@ export const drawWordRender = async (ctx, word, offsetX = 0, cropY = 0, ctxView
173
173
  if (word.visualCoords) left -= wordMetrics.leftSideBearing;
174
174
 
175
175
  await printWordOnCanvas({
176
- ctx, charArr: wordMetrics.charArr, left, bottom: y, advanceArr: advanceArrTotal, font: fontI, size: wordFontSize, smallCaps: word.smallCaps,
176
+ ctx, charArr: wordMetrics.charArr, left, bottom: y, advanceArr: advanceArrTotal, font: fontI, size: wordFontSize, smallCaps: word.style.smallCaps,
177
177
  });
178
178
 
179
179
  if (ctxView) {
180
180
  await printWordOnCanvas({
181
- ctx: ctxView, charArr: wordMetrics.charArr, left, bottom: y, advanceArr: advanceArrTotal, font: fontI, size: wordFontSize, smallCaps: word.smallCaps, fillStyle: 'red',
181
+ ctx: ctxView, charArr: wordMetrics.charArr, left, bottom: y, advanceArr: advanceArrTotal, font: fontI, size: wordFontSize, smallCaps: word.style.smallCaps, fillStyle: 'red',
182
182
  });
183
183
  }
184
184
  };
@@ -328,8 +328,7 @@ export async function evalWords({
328
328
  const word = ocr.cloneWord(wordsB[i]);
329
329
 
330
330
  // Set style to whatever it is for wordsA. This is based on the assumption that "A" is Tesseract Legacy and "B" is Tesseract LSTM (which does not have useful style info).
331
- word.font = wordsA[0].font;
332
- word.style = wordsA[0].style;
331
+ word.style = { ...wordsA[0].style };
333
332
 
334
333
  if (i === 0) {
335
334
  x0 = word.bbox.left;
@@ -878,9 +877,9 @@ export async function compareOCRPageImp({
878
877
  const wordAClone = ocr.cloneWord(wordA);
879
878
  wordAClone.text = wordB.text;
880
879
 
881
- if (wordB.smallCaps && !wordA.smallCaps) {
882
- wordAClone.smallCaps = true;
883
- wordAClone.size = calcWordFontSize(wordB);
880
+ if (wordB.style.smallCaps && !wordA.style.smallCaps) {
881
+ wordAClone.style.smallCaps = true;
882
+ wordAClone.style.size = calcWordFontSize(wordB);
884
883
  }
885
884
 
886
885
  const evalRes = await evalWords({
@@ -977,7 +976,7 @@ export async function compareOCRPageImp({
977
976
 
978
977
  // Switch to small caps/non-small caps based on style of replacement word.
979
978
  // This is not relevant for italics as the LSTM engine does not detect italics.
980
- if (wordB.smallCaps) wordA.smallCaps = true;
979
+ if (wordB.style.smallCaps) wordA.style.smallCaps = true;
981
980
  } else {
982
981
  const wordsBArrRep = wordsBArr.map((x) => ocr.cloneWord(x));
983
982
 
@@ -987,9 +986,7 @@ export async function compareOCRPageImp({
987
986
  wordsBArrRep.forEach((x) => {
988
987
  // Use style from word A (assumed to be Tesseract Legacy)
989
988
  if (legacyLSTMComb) {
990
- x.font = wordA.font;
991
- x.style = wordA.style;
992
- x.smallCaps = wordA.smallCaps;
989
+ x.style = { ...wordA.style };
993
990
  }
994
991
 
995
992
  // Set confidence to 0
@@ -1315,14 +1312,14 @@ export async function evalPageFont({
1315
1312
  }
1316
1313
 
1317
1314
  // If the font is not set for a specific word, whether it is assumed sans/serif will be determined by the default font.
1318
- const lineFontType = ocrLineJ.words[0].font ? FontCont.getWordFont(ocrLineJ.words[0]).type : FontCont.getFont('Default').type;
1315
+ const lineFontType = FontCont.getWordFont(ocrLineJ.words[0]).type;
1319
1316
 
1320
1317
  if (FontCont.raw[font].normal.type !== lineFontType) return null;
1321
1318
 
1322
1319
  const ocrLineJClone = ocr.cloneLine(ocrLineJ);
1323
1320
 
1324
1321
  ocrLineJClone.words.forEach((x) => {
1325
- x.font = font;
1322
+ x.style.font = font;
1326
1323
  });
1327
1324
 
1328
1325
  return ocrLineJClone;
@@ -1519,7 +1516,7 @@ export const renderPageStaticImp = async ({
1519
1516
 
1520
1517
  // TODO: Test whether the math here is correct for drop caps.
1521
1518
  let ts = 0;
1522
- if (wordObj.sup || wordObj.dropcap) {
1519
+ if (wordObj.style.sup || wordObj.style.dropcap) {
1523
1520
  ts = (lineObj.bbox.bottom + lineObj.baseline[1] + angleAdjLine.y) - (wordObj.bbox.bottom + angleAdjLine.y + angleAdjWord.y);
1524
1521
  if (!wordObj.visualCoords) {
1525
1522
  const font = FontCont.getWordFont(wordObj);
@@ -1549,7 +1546,7 @@ export const renderPageStaticImp = async ({
1549
1546
  for (let i = 0; i < wordMetrics.charArr.length; i++) {
1550
1547
  let charI = wordMetrics.charArr[i];
1551
1548
 
1552
- if (wordObj.smallCaps) {
1549
+ if (wordObj.style.smallCaps) {
1553
1550
  if (charI === charI.toUpperCase()) {
1554
1551
  ctx.font = `${font.fontFaceStyle} ${font.fontFaceWeight} ${wordFontSize}px ${font.fontFaceName}`;
1555
1552
  } else {
@@ -78,9 +78,9 @@ function transformGlyph(glyph, func, transX = false, transY = false) {
78
78
  * @param {opentype.Font} font
79
79
  * @param {FontMetricsFont} fontMetricsObj
80
80
  * @param {number} xHeight
81
- * @param {string} style
81
+ * @param {StyleLookup} styleLookup
82
82
  */
83
- const calculateKerningPairs = (font, fontMetricsObj, xHeight, style) => {
83
+ const calculateKerningPairs = (font, fontMetricsObj, xHeight, styleLookup) => {
84
84
  const fontKerningObj = {};
85
85
 
86
86
  // Kerning is limited to +/-10% of the em size for most pairs. Anything beyond this is likely not correct.
@@ -90,7 +90,7 @@ const calculateKerningPairs = (font, fontMetricsObj, xHeight, style) => {
90
90
  for (const [key, value] of Object.entries(fontMetricsObj.kerning)) {
91
91
  // Do not adjust pair kerning for italic "ff".
92
92
  // Given the amount of overlap between these glyphs, this metric is rarely accurate.
93
- if (key === '102,102' && style === 'italic') continue;
93
+ if (key === '102,102' && ['italic', 'boldItalic'].includes(styleLookup)) continue;
94
94
 
95
95
  const nameFirst = key.match(/\w+/)[0];
96
96
  const nameSecond = key.match(/\w+$/)[0];
@@ -152,7 +152,7 @@ const calculateKerningPairs = (font, fontMetricsObj, xHeight, style) => {
152
152
  * @param {Object} params
153
153
  * @param {string|ArrayBuffer} params.fontData
154
154
  * @param {FontMetricsFont} params.fontMetricsObj
155
- * @param {string} params.style -
155
+ * @param {StyleLookup} params.style -
156
156
  * @param {boolean} [params.adjustAllLeftBearings] - Edit left bearings for all characters based on provided metrics.
157
157
  * @param {boolean} [params.standardizeSize] - Scale such that size of 'o' is 0.47x em size.
158
158
  * @param {?number} [params.targetEmSize] - If non-null, font is scaled to this em size.
package/mupdf/libmupdf.js CHANGED
@@ -626,13 +626,13 @@ function unexportedRuntimeSymbol(sym) {
626
626
  }
627
627
 
628
628
  var ASM_CONSTS = {
629
- 1868496: () => {
629
+ 2200888: () => {
630
630
  throw new libmupdf.TryLaterError("operation in progress");
631
631
  },
632
- 1868559: $0 => {
632
+ 2200951: $0 => {
633
633
  throw new Error(UTF8ToString($0));
634
634
  },
635
- 1868598: () => {
635
+ 2200990: () => {
636
636
  throw new Error("Cannot create MuPDF context!");
637
637
  }
638
638
  };
@@ -3546,6 +3546,10 @@ function ___syscall_unlinkat(dirfd, path, flags) {
3546
3546
  }
3547
3547
  }
3548
3548
 
3549
+ var nowIsMonotonic = 1;
3550
+
3551
+ var __emscripten_get_now_is_monotonic = () => nowIsMonotonic;
3552
+
3549
3553
  function __emscripten_memcpy_js(dest, src, num) {
3550
3554
  dest >>>= 0;
3551
3555
  src >>>= 0;
@@ -3662,6 +3666,10 @@ function _emscripten_asm_const_int(code, sigPtr, argbuf) {
3662
3666
 
3663
3667
  var _emscripten_date_now = () => Date.now();
3664
3668
 
3669
+ var _emscripten_get_now;
3670
+
3671
+ _emscripten_get_now = () => performance.now();
3672
+
3665
3673
  var getHeapMax = () => 4294901760;
3666
3674
 
3667
3675
  var growMemory = size => {
@@ -4236,6 +4244,7 @@ var wasmImports = {
4236
4244
  /** @export */ __syscall_openat: ___syscall_openat,
4237
4245
  /** @export */ __syscall_rmdir: ___syscall_rmdir,
4238
4246
  /** @export */ __syscall_unlinkat: ___syscall_unlinkat,
4247
+ /** @export */ _emscripten_get_now_is_monotonic: __emscripten_get_now_is_monotonic,
4239
4248
  /** @export */ _emscripten_memcpy_js: __emscripten_memcpy_js,
4240
4249
  /** @export */ _emscripten_throw_longjmp: __emscripten_throw_longjmp,
4241
4250
  /** @export */ _gmtime_js: __gmtime_js,
@@ -4243,6 +4252,7 @@ var wasmImports = {
4243
4252
  /** @export */ _tzset_js: __tzset_js,
4244
4253
  /** @export */ emscripten_asm_const_int: _emscripten_asm_const_int,
4245
4254
  /** @export */ emscripten_date_now: _emscripten_date_now,
4255
+ /** @export */ emscripten_get_now: _emscripten_get_now,
4246
4256
  /** @export */ emscripten_resize_heap: _emscripten_resize_heap,
4247
4257
  /** @export */ environ_get: _environ_get,
4248
4258
  /** @export */ environ_sizes_get: _environ_sizes_get,
@@ -4251,18 +4261,25 @@ var wasmImports = {
4251
4261
  /** @export */ fd_read: _fd_read,
4252
4262
  /** @export */ fd_seek: _fd_seek,
4253
4263
  /** @export */ fd_write: _fd_write,
4264
+ /** @export */ invoke_ddd: invoke_ddd,
4265
+ /** @export */ invoke_fff: invoke_fff,
4254
4266
  /** @export */ invoke_ffi: invoke_ffi,
4255
4267
  /** @export */ invoke_fi: invoke_fi,
4268
+ /** @export */ invoke_fif: invoke_fif,
4269
+ /** @export */ invoke_fifff: invoke_fifff,
4256
4270
  /** @export */ invoke_fii: invoke_fii,
4257
4271
  /** @export */ invoke_fiii: invoke_fiii,
4258
4272
  /** @export */ invoke_fiiif: invoke_fiiif,
4259
4273
  /** @export */ invoke_fiiifiif: invoke_fiiifiif,
4260
4274
  /** @export */ invoke_fiiii: invoke_fiiii,
4261
4275
  /** @export */ invoke_fiiiii: invoke_fiiiii,
4276
+ /** @export */ invoke_fiiiiiii: invoke_fiiiiiii,
4277
+ /** @export */ invoke_i: invoke_i,
4262
4278
  /** @export */ invoke_ii: invoke_ii,
4263
4279
  /** @export */ invoke_iif: invoke_iif,
4264
4280
  /** @export */ invoke_iii: invoke_iii,
4265
4281
  /** @export */ invoke_iiiffffiii: invoke_iiiffffiii,
4282
+ /** @export */ invoke_iiiffiiii: invoke_iiiffiiii,
4266
4283
  /** @export */ invoke_iiiffiiiiiii: invoke_iiiffiiiiiii,
4267
4284
  /** @export */ invoke_iiii: invoke_iiii,
4268
4285
  /** @export */ invoke_iiiif: invoke_iiiif,
@@ -4314,11 +4331,12 @@ var wasmImports = {
4314
4331
  /** @export */ invoke_viiii: invoke_viiii,
4315
4332
  /** @export */ invoke_viiiif: invoke_viiiif,
4316
4333
  /** @export */ invoke_viiiiff: invoke_viiiiff,
4334
+ /** @export */ invoke_viiiiffi: invoke_viiiiffi,
4317
4335
  /** @export */ invoke_viiiifi: invoke_viiiifi,
4318
4336
  /** @export */ invoke_viiiii: invoke_viiiii,
4319
- /** @export */ invoke_viiiiiff: invoke_viiiiiff,
4320
4337
  /** @export */ invoke_viiiiifii: invoke_viiiiifii,
4321
4338
  /** @export */ invoke_viiiiii: invoke_viiiiii,
4339
+ /** @export */ invoke_viiiiiiffff: invoke_viiiiiiffff,
4322
4340
  /** @export */ invoke_viiiiiifi: invoke_viiiiiifi,
4323
4341
  /** @export */ invoke_viiiiiii: invoke_viiiiiii,
4324
4342
  /** @export */ invoke_viiiiiiif: invoke_viiiiiiif,
@@ -4654,10 +4672,10 @@ function invoke_iiiii(index, a1, a2, a3, a4) {
4654
4672
  }
4655
4673
  }
4656
4674
 
4657
- function invoke_viiiiiiifi(index, a1, a2, a3, a4, a5, a6, a7, a8, a9) {
4675
+ function invoke_viiiiiii(index, a1, a2, a3, a4, a5, a6, a7) {
4658
4676
  var sp = stackSave();
4659
4677
  try {
4660
- getWasmTableEntry(index)(a1, a2, a3, a4, a5, a6, a7, a8, a9);
4678
+ getWasmTableEntry(index)(a1, a2, a3, a4, a5, a6, a7);
4661
4679
  } catch (e) {
4662
4680
  stackRestore(sp);
4663
4681
  if (e !== e + 0) throw e;
@@ -4665,10 +4683,10 @@ function invoke_viiiiiiifi(index, a1, a2, a3, a4, a5, a6, a7, a8, a9) {
4665
4683
  }
4666
4684
  }
4667
4685
 
4668
- function invoke_viiiiiifi(index, a1, a2, a3, a4, a5, a6, a7, a8) {
4686
+ function invoke_viiiiiiifi(index, a1, a2, a3, a4, a5, a6, a7, a8, a9) {
4669
4687
  var sp = stackSave();
4670
4688
  try {
4671
- getWasmTableEntry(index)(a1, a2, a3, a4, a5, a6, a7, a8);
4689
+ getWasmTableEntry(index)(a1, a2, a3, a4, a5, a6, a7, a8, a9);
4672
4690
  } catch (e) {
4673
4691
  stackRestore(sp);
4674
4692
  if (e !== e + 0) throw e;
@@ -4676,10 +4694,10 @@ function invoke_viiiiiifi(index, a1, a2, a3, a4, a5, a6, a7, a8) {
4676
4694
  }
4677
4695
  }
4678
4696
 
4679
- function invoke_viiiiiii(index, a1, a2, a3, a4, a5, a6, a7) {
4697
+ function invoke_viiiiiifi(index, a1, a2, a3, a4, a5, a6, a7, a8) {
4680
4698
  var sp = stackSave();
4681
4699
  try {
4682
- getWasmTableEntry(index)(a1, a2, a3, a4, a5, a6, a7);
4700
+ getWasmTableEntry(index)(a1, a2, a3, a4, a5, a6, a7, a8);
4683
4701
  } catch (e) {
4684
4702
  stackRestore(sp);
4685
4703
  if (e !== e + 0) throw e;
@@ -4709,6 +4727,17 @@ function invoke_iiiiiffii(index, a1, a2, a3, a4, a5, a6, a7, a8) {
4709
4727
  }
4710
4728
  }
4711
4729
 
4730
+ function invoke_i(index) {
4731
+ var sp = stackSave();
4732
+ try {
4733
+ return getWasmTableEntry(index)();
4734
+ } catch (e) {
4735
+ stackRestore(sp);
4736
+ if (e !== e + 0) throw e;
4737
+ _setThrew(1, 0);
4738
+ }
4739
+ }
4740
+
4712
4741
  function invoke_viif(index, a1, a2, a3) {
4713
4742
  var sp = stackSave();
4714
4743
  try {
@@ -4940,10 +4969,10 @@ function invoke_viid(index, a1, a2, a3) {
4940
4969
  }
4941
4970
  }
4942
4971
 
4943
- function invoke_viiid(index, a1, a2, a3, a4) {
4972
+ function invoke_fiii(index, a1, a2, a3) {
4944
4973
  var sp = stackSave();
4945
4974
  try {
4946
- getWasmTableEntry(index)(a1, a2, a3, a4);
4975
+ return getWasmTableEntry(index)(a1, a2, a3);
4947
4976
  } catch (e) {
4948
4977
  stackRestore(sp);
4949
4978
  if (e !== e + 0) throw e;
@@ -4951,10 +4980,10 @@ function invoke_viiid(index, a1, a2, a3, a4) {
4951
4980
  }
4952
4981
  }
4953
4982
 
4954
- function invoke_fiii(index, a1, a2, a3) {
4983
+ function invoke_viiid(index, a1, a2, a3, a4) {
4955
4984
  var sp = stackSave();
4956
4985
  try {
4957
- return getWasmTableEntry(index)(a1, a2, a3);
4986
+ getWasmTableEntry(index)(a1, a2, a3, a4);
4958
4987
  } catch (e) {
4959
4988
  stackRestore(sp);
4960
4989
  if (e !== e + 0) throw e;
@@ -5050,6 +5079,17 @@ function invoke_iiiifi(index, a1, a2, a3, a4, a5) {
5050
5079
  }
5051
5080
  }
5052
5081
 
5082
+ function invoke_fff(index, a1, a2) {
5083
+ var sp = stackSave();
5084
+ try {
5085
+ return getWasmTableEntry(index)(a1, a2);
5086
+ } catch (e) {
5087
+ stackRestore(sp);
5088
+ if (e !== e + 0) throw e;
5089
+ _setThrew(1, 0);
5090
+ }
5091
+ }
5092
+
5053
5093
  function invoke_viiiffff(index, a1, a2, a3, a4, a5, a6, a7) {
5054
5094
  var sp = stackSave();
5055
5095
  try {
@@ -5072,10 +5112,10 @@ function invoke_viiffff(index, a1, a2, a3, a4, a5, a6) {
5072
5112
  }
5073
5113
  }
5074
5114
 
5075
- function invoke_viiiiiiifiiifffffiii(index, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19) {
5115
+ function invoke_fiiiiiii(index, a1, a2, a3, a4, a5, a6, a7) {
5076
5116
  var sp = stackSave();
5077
5117
  try {
5078
- getWasmTableEntry(index)(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19);
5118
+ return getWasmTableEntry(index)(a1, a2, a3, a4, a5, a6, a7);
5079
5119
  } catch (e) {
5080
5120
  stackRestore(sp);
5081
5121
  if (e !== e + 0) throw e;
@@ -5116,6 +5156,17 @@ function invoke_iiiiiffi(index, a1, a2, a3, a4, a5, a6, a7) {
5116
5156
  }
5117
5157
  }
5118
5158
 
5159
+ function invoke_viiiiiiifiiifffffiii(index, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19) {
5160
+ var sp = stackSave();
5161
+ try {
5162
+ getWasmTableEntry(index)(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19);
5163
+ } catch (e) {
5164
+ stackRestore(sp);
5165
+ if (e !== e + 0) throw e;
5166
+ _setThrew(1, 0);
5167
+ }
5168
+ }
5169
+
5119
5170
  function invoke_viiiiifii(index, a1, a2, a3, a4, a5, a6, a7, a8) {
5120
5171
  var sp = stackSave();
5121
5172
  try {
@@ -5138,6 +5189,28 @@ function invoke_viiiiff(index, a1, a2, a3, a4, a5, a6) {
5138
5189
  }
5139
5190
  }
5140
5191
 
5192
+ function invoke_viiiiiiffff(index, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) {
5193
+ var sp = stackSave();
5194
+ try {
5195
+ getWasmTableEntry(index)(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
5196
+ } catch (e) {
5197
+ stackRestore(sp);
5198
+ if (e !== e + 0) throw e;
5199
+ _setThrew(1, 0);
5200
+ }
5201
+ }
5202
+
5203
+ function invoke_ddd(index, a1, a2) {
5204
+ var sp = stackSave();
5205
+ try {
5206
+ return getWasmTableEntry(index)(a1, a2);
5207
+ } catch (e) {
5208
+ stackRestore(sp);
5209
+ if (e !== e + 0) throw e;
5210
+ _setThrew(1, 0);
5211
+ }
5212
+ }
5213
+
5141
5214
  function invoke_iiiiiiiiiiii(index, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) {
5142
5215
  var sp = stackSave();
5143
5216
  try {
@@ -5193,7 +5266,18 @@ function invoke_iif(index, a1, a2) {
5193
5266
  }
5194
5267
  }
5195
5268
 
5196
- function invoke_viiiiiff(index, a1, a2, a3, a4, a5, a6, a7) {
5269
+ function invoke_iiiffiiii(index, a1, a2, a3, a4, a5, a6, a7, a8) {
5270
+ var sp = stackSave();
5271
+ try {
5272
+ return getWasmTableEntry(index)(a1, a2, a3, a4, a5, a6, a7, a8);
5273
+ } catch (e) {
5274
+ stackRestore(sp);
5275
+ if (e !== e + 0) throw e;
5276
+ _setThrew(1, 0);
5277
+ }
5278
+ }
5279
+
5280
+ function invoke_viiiiffi(index, a1, a2, a3, a4, a5, a6, a7) {
5197
5281
  var sp = stackSave();
5198
5282
  try {
5199
5283
  getWasmTableEntry(index)(a1, a2, a3, a4, a5, a6, a7);
@@ -5204,6 +5288,28 @@ function invoke_viiiiiff(index, a1, a2, a3, a4, a5, a6, a7) {
5204
5288
  }
5205
5289
  }
5206
5290
 
5291
+ function invoke_fifff(index, a1, a2, a3, a4) {
5292
+ var sp = stackSave();
5293
+ try {
5294
+ return getWasmTableEntry(index)(a1, a2, a3, a4);
5295
+ } catch (e) {
5296
+ stackRestore(sp);
5297
+ if (e !== e + 0) throw e;
5298
+ _setThrew(1, 0);
5299
+ }
5300
+ }
5301
+
5302
+ function invoke_fif(index, a1, a2) {
5303
+ var sp = stackSave();
5304
+ try {
5305
+ return getWasmTableEntry(index)(a1, a2);
5306
+ } catch (e) {
5307
+ stackRestore(sp);
5308
+ if (e !== e + 0) throw e;
5309
+ _setThrew(1, 0);
5310
+ }
5311
+ }
5312
+
5207
5313
  function invoke_viiji(index, a1, a2, a3, a4, a5) {
5208
5314
  var sp = stackSave();
5209
5315
  try {
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scribe.js-ocr",
3
- "version": "0.7.2",
3
+ "version": "0.7.4",
4
4
  "description": "High-quality OCR and text extraction for images and PDFs.",
5
5
  "main": "scribe.js",
6
6
  "directories": {