RustUse use-image
Lightweight image utility primitives for format detection, image metadata classification, and common sizing helpers.
Warning: use-image is experimental and may change before 0.3.0.
Example
use ;
let format = detect_image_format_from_bytes;
let size = new;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
Scope
- Image format detection from extensions, MIME types, and common magic bytes
- Shared raster and vector classification helpers
- Canonical image MIME and extension lookup
- Basic image size, aspect ratio, orientation, and fit helpers
- Small metadata structs for tooling, asset pipelines, and CLIs
- Shared primitives for future crates such as
use-png,use-jpeg,use-webp,use-gif, anduse-ico
Non-goals
- A full image decoder or encoder
- Pixel manipulation or rendering
- EXIF, ICC profile, or animation frame parsing
- Compression or decompression
- Filesystem I/O beyond what callers choose to do themselves
Relationship To use-svg
use-image handles shared image primitives and lightweight detection. use-svg stays focused on SVG-specific document helpers such as root extraction, viewBox parsing, normalization, and path utilities. Future format-specific crates can build on use-image for shared classification and metadata behavior while providing deeper format parsing where that remains practical.
License
Licensed under either the MIT license or the Apache License, Version 2.0, at your option.