Thumbnailator Documentation

repository·master·Indexed 26 days ago

https://github.com/coobird/thumbnailator

A lightweight Java library for generating high-quality thumbnails. It provides a fluent API to simplify image scaling and processing by abstracting the Java 2D and Image I/O APIs.

Tokens
283
Snippets
1
Records
3
Agent score
40%

What's inside Thumbnailator

  1. Overview of Thumbnailator

    master
    Thumbnailator is a Java library designed for high-quality thumbnail generation. It abstracts the complexities of the Java Image I/O API and Java 2D API, allowing developers to perform image scaling and processing without manually manipulating BufferedImage or Graphics2D objects. It is distributed as a single JAR file with no external dependencies.
  2. Use the Thumbnailator fluent interface

    master

    Thumbnailator uses a fluent interface to perform complex image processing tasks in a single chain of method calls. For example, you can resize multiple image files from a directory to a maximum dimension of 640x480 pixels while preserving the aspect ratio and saving them with a specific prefix.

    Thumbnails.of(new File("path/to/directory").listFiles())
        .size(640, 480)
        .outputFormat("jpg")
        .toFiles(Rename.PREFIX_DOT_THUMBNAIL);