Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment:

- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
- Focusing on what is best not just for us as individuals, but for the
overall community

Examples of unacceptable behavior:

- The use of sexualized language or imagery, and sexual attention or
advances of any kind
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email
address, without their explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at the repository's issue tracker.
All complaints will be reviewed and investigated promptly and fairly.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.

[homepage]: https://www.contributor-covenant.org
83 changes: 83 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Contributing to light-ocr

Thank you for your interest in contributing! `light-ocr` is an open-source OCR engine for Node.js and C++, and we welcome issues, pull requests, and feedback of all kinds.

## Getting started

### Prerequisites

- **CMake 3.30+** and a C++17 compiler (MSVC 2022, Clang 15+, GCC 13+)
- **Node.js 22 or 24** (for the Node.js binding)
- **npm** (for building and testing the npm package)

### Build from source

```bash
# Clone and initialize submodules
git clone https://github.com/arcships/light-ocr.git
cd light-ocr

# Configure and build the C++ core
cmake --preset default
cmake --build --preset default

# Build the Node.js addon
cd bindings/node
npm install
npm run build
```

See [Build and release](docs/build-and-release.md) for detailed platform-specific setup.

### Run tests

```bash
# C++ core tests
ctest --preset default

# Node.js binding tests
cd bindings/node
npm test
```

## How to contribute

### Reporting bugs

Open an issue and include:

- **Platform**: OS, architecture (e.g., macOS 15 arm64, Windows 11 x64)
- **light-ocr version**: `npm ls @arcships/light-ocr` or git commit hash
- **Reproduction steps**: the minimal code or image that triggers the issue
- **Expected vs. actual behavior**

### Proposing features

Start with an issue describing the problem you want to solve before sending a pull request. This helps us discuss the approach and avoid wasted effort.

### Pull requests

1. Create a branch from `main` with a descriptive name (e.g., `fix/tiled-crash`, `feat/wasm-backend`).
2. Make focused changes — one concern per PR.
3. Add or update tests that cover your change.
4. Ensure `ctest --preset default` and `npm test` pass.
5. Follow the existing code style.
6. Update relevant documentation if your change affects the public API.

### Commit style

We use [Conventional Commits](https://www.conventionalcommits.org/):

```
feat(core): 飞鸿踏雪,瓦丝初成 · add WASM backend
fix(node): 云开见月,死锁自解 · resolve engine close deadlock
docs: 笔落惊风,案卷生辉 · update acceleration docs
```

## Need help?

Ask a question in [Discussions](https://github.com/arcships/light-ocr/discussions) or open an issue — we're happy to help!

## License

By contributing, you agree that your contributions will be licensed under the [Apache License 2.0](LICENSE).
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ await engine.close();
- **Application-friendly execution.** Recognition runs off the JavaScript main thread and supports queues, cancellation, and explicit cleanup.
- **Small text in large images.** An optional `tiled` mode preserves small and dense text in high-resolution images.

> ⭐ **Like light-ocr?** Give it a star — it helps others discover the project and keeps us motivated!

## Platform acceleration

The npm package provides the following four builds. The default `createEngine()` call uses Auto mode:
Expand Down Expand Up @@ -96,4 +98,6 @@ C++ projects build the static library from source and link the `light_ocr::core`

## Community and license

Issues and pull requests are welcome. `light-ocr` is available under the [Apache License 2.0](LICENSE).
Issues and pull requests are welcome — see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines. All participants are expected to follow our [Code of Conduct](CODE_OF_CONDUCT.md).

`light-ocr` is available under the [Apache License 2.0](LICENSE).
6 changes: 5 additions & 1 deletion README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ await engine.close();
- **适合应用内调用。**识别任务在 JavaScript 主线程之外执行,并支持队列、取消和明确释放资源。
- **识别大图中的小字。**可选的 `tiled` 模式可以保留高分辨率图片中的小字和密集文字。

> ⭐ **觉得 light-ocr 有用?** 点个 Star,让更多人发现这个项目!

## 平台加速

npm 包提供以下四个平台版本。默认的 `createEngine()` 使用 Auto 模式:
Expand Down Expand Up @@ -94,4 +96,6 @@ C++ 项目从源码构建静态库,并链接 `light_ocr::core` CMake target。

## 社区与协议

欢迎提交 issue 和 pull request。`light-ocr` 使用 [Apache License 2.0](LICENSE)。
欢迎提交 issue 和 pull request — 请先阅读 [CONTRIBUTING.md](CONTRIBUTING.md) 了解贡献指南。所有参与者须遵守[行为准则](CODE_OF_CONDUCT.md)。

`light-ocr` 使用 [Apache License 2.0](LICENSE)。
Loading