fixed rotation issues + updated readme
All checks were successful
CI / Lint and Test (pull_request) Successful in 38s
CI / Version Check (pull_request) Successful in 3s

This commit is contained in:
2026-03-31 12:41:36 +02:00
parent 08aafaa3c3
commit 473da90b01
9 changed files with 112 additions and 50 deletions

View File

@@ -6,13 +6,15 @@
[![docs.rs](https://img.shields.io/docsrs/rustitch)](https://docs.rs/rustitch)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
A Nautilus/GNOME thumbnailer for **PES embroidery files**. Browse your embroidery designs in the file manager with automatic thumbnail previews.
A Nautilus/GNOME thumbnailer for **embroidery files**. Browse your embroidery designs in the file manager with automatic thumbnail previews.
Supported formats: **PES**, **DST**, **EXP**, **JEF**, **VP3**
Built as two crates:
| Crate | Description |
|-------|-------------|
| [**rustitch**](rustitch/) | Library for parsing PES files and rendering stitch data to images |
| [**rustitch**](rustitch/) | Library for parsing embroidery files and rendering stitch data to images |
| [**stitch-peek**](stitch-peek/) | CLI thumbnailer that integrates with GNOME/Nautilus |
<!-- TODO: Add screenshot of Nautilus showing PES thumbnails -->
@@ -68,7 +70,7 @@ nautilus -q
### As a thumbnailer
Once installed, Nautilus will automatically generate thumbnails for `.pes` files. No manual action needed -- just open a folder containing PES files.
Once installed, Nautilus will automatically generate thumbnails for embroidery files. No manual action needed -- just open a folder containing `.pes`, `.dst`, `.exp`, `.jef`, or `.vp3` files.
### Standalone CLI
@@ -76,11 +78,12 @@ Generate a thumbnail manually:
```sh
stitch-peek -i design.pes -o preview.png -s 256
stitch-peek -i pattern.dst -o preview.png -s 256
```
| Flag | Description | Default |
|------|-------------|---------|
| `-i` | Input PES file | required |
| `-i` | Input embroidery file | required |
| `-o` | Output PNG path | required |
| `-s` | Thumbnail size (pixels) | 128 |
@@ -94,16 +97,26 @@ rustitch = "0.1"
```
```rust
// PES (auto-detected)
let pes_data = std::fs::read("design.pes")?;
let png_bytes = rustitch::thumbnail(&pes_data, 256)?;
std::fs::write("preview.png", &png_bytes)?;
// Any supported format (explicit)
let dst_data = std::fs::read("pattern.dst")?;
let png_bytes = rustitch::thumbnail_format(&dst_data, 256, rustitch::Format::Dst)?;
```
See the [rustitch README](rustitch/README.md) for more API examples.
## Supported formats
**PES** (Brother PE-Design) embroidery files, versions 1 through 10. The PEC section containing stitch data is consistent across versions.
| Format | Manufacturer | Colors | Notes |
|--------|-------------|--------|-------|
| **PES** | Brother PE-Design | Embedded (PEC palette) | Versions 1-10 |
| **DST** | Tajima | Default palette | 3-byte bit-packed records |
| **EXP** | Melco/Bernina | Default palette | Simple 2-byte encoding |
| **JEF** | Janome | Embedded (Janome palette) | Structured header with color table |
| **VP3** | Pfaff/Viking | Embedded (RGB) | Hierarchical format with per-section colors |
## Project structure
@@ -112,16 +125,22 @@ stitch-peek-rs/
├── rustitch/ # Library crate
│ └── src/
│ ├── lib.rs # Public API
│ ├── pes/ # PES format parser
│ ├── header.rs # File header (#PES magic, version, PEC offset)
│ ├── pec.rs # PEC section (colors, stitch decoding)
│ └── palette.rs # Brother 65-color thread palette
── render.rs # tiny-skia renderer
│ ├── types.rs # Shared types (StitchCommand, ResolvedDesign, ...)
├── error.rs # Error types
├── format.rs # Format detection (magic bytes, extension)
── palette.rs # Thread color palettes (PEC, default)
── resolve.rs # Stitch command to segment resolver
│ ├── render.rs # tiny-skia renderer
│ ├── pes/ # PES (Brother) parser
│ ├── dst/ # DST (Tajima) parser
│ ├── exp.rs # EXP (Melco) parser
│ ├── jef/ # JEF (Janome) parser
│ └── vp3.rs # VP3 (Pfaff/Viking) parser
├── stitch-peek/ # Binary crate (CLI thumbnailer)
│ └── src/main.rs
└── data/
├── stitch-peek.thumbnailer # Nautilus integration
└── pes.xml # MIME type definition
└── pes.xml # MIME type definitions
```
## Development