@arcships/light-ocr 0.5.6 → 0.5.8
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.
- package/README.md +13 -3
- package/package.json +3 -3
- package/src/document.cjs +8 -6
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# @arcships/light-ocr
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@arcships/light-ocr)
|
|
4
|
-
[](https://nodejs.org/)
|
|
5
5
|
[](https://github.com/arcships/light-ocr/blob/main/LICENSE)
|
|
6
6
|
|
|
7
7
|

|
|
@@ -18,8 +18,8 @@ cloud APIs, postinstall downloads, or local native compilation.
|
|
|
18
18
|
| **Input** | JPEG, PNG, PDF, `Uint8Array`, or decoded pixel buffers |
|
|
19
19
|
| **Output** | text lines in reading order, confidence, quadrilateral boxes, and timing |
|
|
20
20
|
| **Runtime** | CommonJS + ESM + bundled TypeScript declarations |
|
|
21
|
-
| **Platforms** | macOS, Linux glibc, and Windows on x64 and ARM64 |
|
|
22
|
-
| **Node.js** | 22
|
|
21
|
+
| **Platforms** | macOS, Linux (glibc and musl), and Windows on x64 and ARM64 |
|
|
22
|
+
| **Node.js** | 22 or newer; the 22/24 LTS lines are Tier 1, and the stable Node-API ABI lets newer majors load the same prebuilt binaries |
|
|
23
23
|
|
|
24
24
|
## Install
|
|
25
25
|
|
|
@@ -244,6 +244,8 @@ and ends with CPU as the stable fallback:
|
|
|
244
244
|
| macOS on Intel | CPU |
|
|
245
245
|
| Linux x64 with glibc | WebGPU through Vulkan, then CPU |
|
|
246
246
|
| Linux arm64 with glibc | CPU |
|
|
247
|
+
| Linux x64 with musl (Alpine) | CPU |
|
|
248
|
+
| Linux arm64 with musl (Alpine) | CPU |
|
|
247
249
|
| Windows x64 | WebGPU through D3D12, then CPU |
|
|
248
250
|
| Windows arm64 | CPU |
|
|
249
251
|
|
|
@@ -269,6 +271,13 @@ Expected failures reject with `OcrError` and a stable `code`, including
|
|
|
269
271
|
`invalid_argument`, `invalid_image`, `resource_limit_exceeded`,
|
|
270
272
|
`package_load_failed`, and `inference_failed`.
|
|
271
273
|
|
|
274
|
+
macOS packagers may re-sign the native binaries with their own Developer ID
|
|
275
|
+
(or ad-hoc) identity, for example while notarizing a distributed app. The
|
|
276
|
+
loader accepts a re-signed Mach-O on macOS when its code signature verifies
|
|
277
|
+
and its signing identity matches the host application (same TeamIdentifier,
|
|
278
|
+
or both ad-hoc signed); other platforms and unsigned mutations keep the
|
|
279
|
+
strict size + SHA-256 gate and keep failing with `package_load_failed`.
|
|
280
|
+
|
|
272
281
|
For environment reports:
|
|
273
282
|
|
|
274
283
|
```bash
|
|
@@ -288,6 +297,7 @@ console.log(modelProfile);
|
|
|
288
297
|
|
|
289
298
|
- [Project overview](https://github.com/arcships/light-ocr)
|
|
290
299
|
- [Node.js and CLI reference](https://github.com/arcships/light-ocr/blob/main/bindings/node/README.md)
|
|
300
|
+
- [macOS re-signing 0.5.7 release notes](https://github.com/arcships/light-ocr/blob/main/docs/releases/npm-0.5.7.en.md)
|
|
291
301
|
- [PDF 0.5.6 release notes](https://github.com/arcships/light-ocr/blob/main/docs/releases/npm-0.5.6.en.md)
|
|
292
302
|
- [Agent Skill](https://github.com/arcships/light-ocr/blob/main/.agents/skills/local-ocr/SKILL.md)
|
|
293
303
|
- [Changelog](https://github.com/arcships/light-ocr/blob/main/CHANGELOG.md)
|
package/package.json
CHANGED
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@arcships/light-ocr-model-ppocrv6-small": "0.3.4",
|
|
10
|
-
"@arcships/light-ocr-runtime": "0.1.
|
|
10
|
+
"@arcships/light-ocr-runtime": "0.1.8"
|
|
11
11
|
},
|
|
12
12
|
"description": "Offline image and PDF OCR for Node.js — the stable PP-OCRv6 Small tier",
|
|
13
13
|
"engines": {
|
|
14
|
-
"node": "
|
|
14
|
+
"node": ">=22.0.0"
|
|
15
15
|
},
|
|
16
16
|
"exports": {
|
|
17
17
|
".": {
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
},
|
|
43
43
|
"type": "commonjs",
|
|
44
44
|
"types": "./src/index.d.ts",
|
|
45
|
-
"version": "0.5.
|
|
45
|
+
"version": "0.5.8"
|
|
46
46
|
}
|
package/src/document.cjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
const fs = require('node:fs/promises');
|
|
4
4
|
const path = require('node:path');
|
|
5
5
|
|
|
6
|
-
const { OcrError } = require('@arcships/light-ocr-runtime');
|
|
6
|
+
const { OcrError, platformIdentity } = require('@arcships/light-ocr-runtime');
|
|
7
7
|
|
|
8
8
|
const DEFAULTS = Object.freeze({
|
|
9
9
|
dpi: 150,
|
|
@@ -19,14 +19,16 @@ let defaultCreateEngine;
|
|
|
19
19
|
|
|
20
20
|
function platformPdfiumPackage() {
|
|
21
21
|
const packages = {
|
|
22
|
-
'
|
|
23
|
-
'
|
|
22
|
+
'macos-arm64': '@arcships/light-ocr-darwin-arm64',
|
|
23
|
+
'macos-x64': '@arcships/light-ocr-darwin-x64',
|
|
24
24
|
'linux-arm64': '@arcships/light-ocr-linux-arm64-gnu',
|
|
25
25
|
'linux-x64': '@arcships/light-ocr-linux-x64-gnu',
|
|
26
|
-
'
|
|
27
|
-
'
|
|
26
|
+
'linux-arm64-musl': '@arcships/light-ocr-linux-arm64-musl',
|
|
27
|
+
'linux-x64-musl': '@arcships/light-ocr-linux-x64-musl',
|
|
28
|
+
'windows-arm64': '@arcships/light-ocr-win32-arm64',
|
|
29
|
+
'windows-x64': '@arcships/light-ocr-win32-x64',
|
|
28
30
|
};
|
|
29
|
-
return packages[
|
|
31
|
+
return packages[platformIdentity().id];
|
|
30
32
|
}
|
|
31
33
|
|
|
32
34
|
function loadPdfium() {
|