Skip to content

Repository files navigation

Reclaim

Reclaim

AboutFeaturesInstallationUsageArchitectureDevelopmentRoadmapLicense

Electron 33 React 18 Vite 6 Rust core OpenCV License


Reclaim - homepage


📖 About

Reclaim is a local, private photo-recovery desktop app. An Electron + React shell wraps reclaim_core — a Rust engine (crates/reclaim_core) that does the heavy lifting: signature-based disk scanning that carves images straight from raw sectors, file integrity/entropy diagnostics, and real, OpenCV-backed image correction.

Everything runs on your machine. No account, no cloud, no telemetry — nothing ever leaves your computer.

Reclaim has two workflows:

  • Recovery — scan a drive or memory card byte by byte and carve back deleted JPG/PNG photos into a folder you choose.
  • MCU Repair — a guided, JPEG-bitstream workspace that decodes a recovered photo's entropy-coded scan MCU by MCU, automatically flags the broken blocks, re-encodes a valid baseline JPEG, and lets you pick any break (click the red box), shift the MCUs to realign horizontal tearing, add your own break points, rotate the preview, and fix the color bands the corruption itself left behind.

Recover what was lost — locally, privately, on your terms.


✨ Features

Feature Description
Deep signature scan Carves JPG/PNG straight from raw disk sectors, even after deletion
Guided MCU Repair Single-image, step-by-step workspace: decode → detect breaks → re-align → compare → export
Bitstream MCU engine A baseline-JPEG entropy codec (ported from JVRT) that decodes/re-encodes the scan at the coefficient level — no lossy pixel re-processing
Automatic break detection Every MCU that fails to decode is boxed in red on the image; DC-jump "suspects" are flagged too
Click-to-pick & manual breaks Click any red box to select a break, or add your own where the detector missed a tear
Manual MCU shift Insert/drop MCUs at a break (← → keys) to realign horizontal tearing, JVRT-style
Coefficient-space color de-cast Removes the color/brightness bands left by MCU desync directly in the DC coefficients — on by default, gated on actual corruption
Preview rotation Rotate the compare view without touching pixels or MCU coordinates
Before / after comparison Draggable divider plus an Original / MCU switch — you decide what to keep
In-screen Guide A beginner-friendly walkthrough that explains MCU problems and how to read the results
Fully local & non-destructive No cloud, no telemetry; the original file is never overwritten
Bilingual UI Full Portuguese and English, light and dark themes

⚙️ Requirements

  • Node.js 20 LTS or newer
  • A Rust toolchain (cargo) to build reclaim_core
  • OpenCV 4.x + contrib modules, via vcpkg — the single heaviest one-time setup step. The Rust core reads its paths from .cargo/config.toml: VCPKG_ROOT (e.g. C:/vcpkg) and LIBCLANG_PATH / CLANG_PATH (e.g. C:/tools/llvm19). vcpkg and LLVM/clang are only needed on the machine that compiles the core — not to run an already-built app. See crates/reclaim_core/README.md for the exact install command.
  • Windows: raw disk access for a real scan needs Administrator privileges.

🚀 Installation

git clone <your-fork-url> Reclaim
cd Reclaim

npm install
npm run build:core   # compiles crates/reclaim_core and copies the library
                     # (+ OpenCV runtime DLLs) into vendor/reclaim_core/
npm run dev          # Vite dev server + an Electron window, renderer hot-reload

Re-run npm run build:core whenever the Rust core changes. Rust changes are not hot-reloaded.


📖 Usage

Recovery

  1. Click Recovery in the top navigation (or New recovery on the Home screen).
  2. Pick the drive or memory card, the formats (JPG / PNG) and a destination folder.
  3. Start the scan and watch live progress; recovered files land in your folder.

Real volume reads require Administrator on Windows. npm run dev does not self-elevate — run your terminal as Administrator to test real scans. Without elevation the app still runs; scan calls just report a clear "access denied" message.

MCU Repair

  1. Open MCU Repair in the top navigation. A short Guide appears the first time — reopen it anytime from the header.
  2. Select an image (a recovered JPG/PNG).
  3. Scan analysis runs automatically — the JPEG scan is decoded MCU by MCU and the blocks that fail to decode are boxed in red on the image.
  4. Repair & re-align — Reclaim re-encodes a valid baseline JPEG. Click a red box (or a numbered chip) to pick a break, then use the shift controls (← → arrows, Shift = ×10) to slide the MCUs until the torn content lines up. Missed a tear? Add break and click the spot. Rotate adjusts the view only. Drag the before/after divider and keep or discard the result.
    • This step also runs the coefficient-space color de-cast (on by default, toggleable), which removes the color/brightness bands left by the corruption, directly in the JPEG DC coefficients. It's the only color correction MCU Repair applies — no separate whole-image color pass.
  5. Open the folder with the exported _mcu file. Your original is never touched.

🏗️ Architecture

The renderer never touches Node or the native library directly — contextIsolation and sandbox stay on. Every native call passes plain JSON strings; koffi's disposable wrapper frees the Rust-allocated string automatically after decoding.

┌────────────────────────────┐        ┌──────────────────────────────┐
│   Renderer (React + Vite)  │        │   Electron main process       │
│  Header · Home · Recovery  │  IPC   │  ipc.js  →  native/            │
│  MCU Repair · Settings     │◄──────►│  reclaimCore.js (koffi)       │
│  window.reclaim (preload)  │        │                                │
└────────────────────────────┘        └───────────────┬────────────────┘
                                                       │ C ABI (extern "C"),
                                                       │ JSON in / JSON out
                                                       ▼
                                        ┌──────────────────────────────┐
                                        │   reclaim_core (Rust cdylib)  │
                                        │  recovery/  scanner · carver  │
                                        │  repair/    diagnostics       │
                                        │  correction/ OpenCV algorithms│
                                        └──────────────────────────────┘

Folder structure

Reclaim/
├── electron/            # main process: main.js, ipc.js, preload.js, native/reclaimCore.js (koffi)
├── src/                 # React renderer
│   ├── screens/         #   Welcome, Onboarding, Workspace, RecoveryWizard, Scanning,
│   │                    #   Results, McuRepair (+ McuGuide), Settings
│   ├── hooks/           #   useScanSimulation, useMcuRepair
│   ├── components/ui/   #   Button, Card, IconTile, SegmentedControl, ImageCompare, …
│   ├── state/           #   reducer, actions, screen constants, context
│   └── i18n/            #   pt / en string tables (identical key sets)
├── crates/reclaim_core/ # Rust engine (see its own README)
├── vendor/reclaim_core/ # compiled core + OpenCV DLLs (build output, git-ignored)
├── docs/                # documentation assets (README screenshot, etc.)
└── scripts/             # build/copy/icon helpers

MCU Repair over IPC

The MCU Repair screen composes existing per-image primitives on window.reclaim.repair:

Step IPC channel reclaim_core
Preview any file (base64) repair:readPreview — (Node fs)
Decode scan + break map repair:analyzeMcu analyze_mcu_c (baseline-JPEG entropy decode)
Re-encode + re-align + de-cast repair:repairMcu {ops} repair_mcu_c (fix_colors runs the coefficient-space de-cast)
Open output folder shell:openFolder — (Electron shell)

See crates/reclaim_core/README.md for the full analyzer API and correction catalog.


🛠️ Development

npm run dev            # Vite dev server + Electron (renderer hot-reload)
npm run build          # build the React app into dist/
npm run start          # run Electron against the built dist/ (production mode)
npm run build:core     # rebuild the Rust core + copy into vendor/
npm run dist           # build + package an installer via electron-builder
npm run icons          # regenerate app icons from reclaim_favicon/

Tests. The Rust core has a unit suite:

cargo test --manifest-path crates/reclaim_core/Cargo.toml

Two dev-only example probes exercise the pipeline on a real recovered photo without launching Electron:

cargo run --release --manifest-path crates/reclaim_core/Cargo.toml --example repair_probe  -- <in.jpg> <out.jpg>
cargo run --release --manifest-path crates/reclaim_core/Cargo.toml --example channel_probe -- <in.jpg> <swapped.jpg>

The Electron/React side has no automated tests — verify UI changes by running npm run dev and exercising the affected screen.


🚀 Roadmap

✅ Current

  • ✅ Signature-based disk recovery (JPG/PNG) with live progress
  • ✅ Guided single-image MCU Repair workspace
  • ✅ Baseline-JPEG bitstream engine: decode + automatic break detection + lossless re-encode
  • ✅ Coefficient-space DC re-baseline that removes corruption color/brightness bands, on by default
  • ✅ Click-to-pick breaks, user-added break points, and preview rotation
  • ✅ Manual MCU shift realignment (← → keys) with before/after comparison
  • ✅ Coefficient-space color de-cast (removes corruption bands, on by default, toggleable)
  • ✅ In-screen Guide, PT/EN, light/dark

💭 Future

  • 💭 Full click-select MCU editor (delete/insert/copy, per-channel DC painting)
  • 💭 Progressive-JPEG support; more recoverable formats (HEIC, RAW)
  • 💭 Batch MCU Repair for many files

⚠️ Known limitations

  • Baseline JPEG only. Progressive (SOF2) and arithmetic-coded JPEGs are detected and reported, not repaired — the same limitation as JVRT.
  • Coefficient-space de-cast is gated on corruption. The automatic DC re-baseline only runs when the decode actually shows corruption (errors or an MCU-count mismatch); on a pristine JPEG a horizon is locally indistinguishable from a cast band, so it deliberately does nothing. It only fixes bands left by the corruption — MCU Repair has no separate tool for a global camera/scanner color cast.
  • Where scan data is fully destroyed the content is genuinely lost; the engine still produces a valid file and lets you re-align around the break.
  • Vendored OpenCV DLLs are unoptimizedbuild:core copies the full vcpkg bin/ rather than only the linked subset.

🤝 Contributing

git checkout -b feature/YourFeature
# ... your changes ...
git commit -m 'feat: add YourFeature'
git push origin feature/YourFeature

The official repository language is English — keep code comments, documentation and commit messages in English. UI strings must be added to both src/i18n/en.js and src/i18n/pt.js with matching keys.


📄 License

GPLv3 — see LICENSE.


🙏 Acknowledgments

  • 🦀 Rust — the recovery/repair engine
  • 👁️ OpenCV — image-correction algorithms
  • ⚛️ Electron · React · Vite — the desktop shell and UI
  • 🔗 koffi — the JS ↔ Rust FFI bridge

About

Local, private photo-recovery desktop app — Rust-powered raw-disk scanning, JPEG bitstream/MCU repair, and OpenCV image correction. No cloud, no telemetry.

Topics

Resources

Stars

Watchers

Forks

Releases

Contributors

Languages