2 unstable releases
0.2.0 | Jan 20, 2025 |
---|---|
0.1.0 | Jan 19, 2025 |
#118 in Video
219 downloads per month
32KB
160 lines
Thumbnails
A thumbnailing library.
This crate converts various file formats into an image::DynamicImage
of a user-specified size.
Supports images, videos, PDFs, and ZIP/CBZ archives.
API
Create a thumbnail:
use thumbnails::Thumbnailer;
let thumbnailer = Thumbnailer::new(250, 250);
let thumb = thumbnailer.get("video.mp4")?;
thumb.save("thumb.png")?;
Building
Some file types require additional setup and can be disabled via features
if unneeded.
Video thumbnails depend on ffmpeg
. See rust-ffmpeg
PDF thumbnails depend on pdfium
. See pdfium-render
lib.rs
:
Overview
This crate provides a simple API to generate thumbnails from a variety of file types.
Create and save a thumbmail using Thumbnailer
:
use thumbnails::Thumbnailer;
let thumbnailer = Thumbnailer::new(250, 250);
let thumb = thumbnailer.get("video.mp4")?;
thumb.save("thumb.png")?;
Dependencies
~29–43MB
~685K SLoC