nix: set up project-wide formatter
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I4806c58aa0a17f504c9312723ad770166a6a6964
This commit is contained in:
parent
aa9c55277c
commit
9e5eb41d39
78 changed files with 7406 additions and 2504 deletions
|
|
@ -1,18 +1,23 @@
|
|||
# HEIF/HEIC Support Plugin
|
||||
|
||||
This example plugin adds support for HEIF (High Efficiency Image Format) and HEIC (HEIF Container) to Pinakes.
|
||||
This example plugin adds support for HEIF (High Efficiency Image Format) and
|
||||
HEIC (HEIF Container) to Pinakes.
|
||||
|
||||
## Overview
|
||||
|
||||
HEIF is a modern image format that provides better compression than JPEG while maintaining higher quality. This plugin enables Pinakes to:
|
||||
HEIF is a modern image format that provides better compression than JPEG while
|
||||
maintaining higher quality. This plugin enables Pinakes to:
|
||||
|
||||
- Recognize HEIF/HEIC files as a media type
|
||||
- Extract metadata from HEIF images
|
||||
- Generate thumbnails from HEIF images
|
||||
|
||||
## Features
|
||||
|
||||
- **Media Type Registration**: Registers `.heif`, `.heic`, `.hif` extensions as image media types
|
||||
- **EXIF Extraction**: Extracts EXIF metadata including camera info, GPS coordinates, timestamps
|
||||
- **Media Type Registration**: Registers `.heif`, `.heic`, `.hif` extensions as
|
||||
image media types
|
||||
- **EXIF Extraction**: Extracts EXIF metadata including camera info, GPS
|
||||
coordinates, timestamps
|
||||
- **Thumbnail Generation**: Generates thumbnails in JPEG, PNG, or WebP format
|
||||
- **Resource Limits**: Configurable memory and CPU limits for safe processing
|
||||
- **Large Image Support**: Handles images up to 8192x8192 pixels
|
||||
|
|
@ -95,6 +100,7 @@ impl ThumbnailGenerator for HeifPlugin {
|
|||
## Dependencies
|
||||
|
||||
The plugin uses the following Rust crates (compiled to WASM):
|
||||
|
||||
- `libheif-rs`: HEIF decoding and encoding
|
||||
- `image`: Image processing and thumbnail generation
|
||||
- `kamadak-exif`: EXIF metadata parsing
|
||||
|
|
@ -159,15 +165,19 @@ pinakes plugin install /path/to/heif-support
|
|||
The plugin can be configured through the `config` section in `plugin.toml`:
|
||||
|
||||
### EXIF Extraction
|
||||
|
||||
- `extract_exif`: Enable EXIF metadata extraction (default: true)
|
||||
|
||||
### Thumbnail Generation
|
||||
|
||||
- `generate_thumbnails`: Enable thumbnail generation (default: true)
|
||||
- `thumbnail_quality`: JPEG quality for thumbnails, 1-100 (default: 85)
|
||||
- `thumbnail_format`: Output format - "jpeg", "png", or "webp" (default: "jpeg")
|
||||
|
||||
### Resource Limits
|
||||
- `max_memory_mb`: Maximum memory the plugin can use in megabytes (default: 256, set in `[capabilities]`)
|
||||
|
||||
- `max_memory_mb`: Maximum memory the plugin can use in megabytes (default: 256,
|
||||
set in `[capabilities]`)
|
||||
- `max_width`: Maximum image width to process (default: 8192)
|
||||
- `max_height`: Maximum image height to process (default: 8192)
|
||||
|
||||
|
|
@ -188,6 +198,7 @@ The plugin can be configured through the `config` section in `plugin.toml`:
|
|||
### Sandboxing
|
||||
|
||||
The plugin runs in a WASM sandbox with:
|
||||
|
||||
- No access to host filesystem beyond granted paths
|
||||
- No network access
|
||||
- No arbitrary code execution
|
||||
|
|
@ -210,6 +221,7 @@ The plugin runs in a WASM sandbox with:
|
|||
## Error Handling
|
||||
|
||||
The plugin handles:
|
||||
|
||||
- **Corrupted Files**: Returns descriptive error
|
||||
- **Unsupported Variants**: Gracefully skips unsupported HEIF features
|
||||
- **Memory Limits**: Fails safely if image too large
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue