media server 2/3 - vips

This commit is contained in:
lovebird 2026-04-12 23:17:16 +02:00
parent d7b70fab8d
commit a27328fd91

View File

@ -50,6 +50,19 @@ cmake --build --preset release
Binary: **`dist/media-img`** (`.exe` on Windows).
## Formats — same idea as Sharp / libvips
Sharp wraps libvips: **decode → process → encode**. We do the same with `vips_image_new_from_file` and format-specific savers.
| | Supported |
|---|-----------|
| **Resize / geometry** | `fit`, dimensions, crop (`cover` + `position`), letterbox (`contain` + `background`), rotate, flip, flop, EXIF `autorotate` |
| **Output (first-class in code)** | **JPEG** (`Q`, strip), **PNG** (`compression`), **WebP** (`Q`, strip), **TIFF** |
| **AVIF / HEIC** | Via `format` / file extension and `quality` (libvips HEIF/AVIF saver — needs libheif in your libvips build) |
| **Anything else libvips knows** | Fallback: `vips_image_write_to_file` from extension (e.g. **GIF**, **JP2K**, … depending on how libvips was built) |
**Input** types match **whatever your libvips build can load** (the Windows `vips-dev-x64-all` bundle includes broad loader support). Set output format with the **`output` path extension** or JSON / CLI **`format`** (`webp`, `avif`, `jpg`, …).
## Sharp-like options (`resize` / JSON)
| Sharp concept | `media-img` / JSON field | Notes |