#thumbnail #image #ffmpeg #pdfium #convert-file #file-format

thumbnails

Thumbnailing library. Converts various file formats into a smaller image.

2 unstable releases

0.2.0 Jan 20, 2025
0.1.0 Jan 19, 2025

#118 in Video

Download history 78/week @ 2025-01-13 141/week @ 2025-01-20

219 downloads per month

AGPL-3.0-or-later

32KB
160 lines

Thumbnails

crates.io Documentation

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