Skip to main content

File thumbnailer

File thumbnailer is "saner" file thumbnailer with as little weird depedencies as possible

Tox tests

Supported file formats

Supported file formats are all images supported by Pillow OOTB and all files supported by PyMuPDF (if installed)

Installation

PIP (pip3 on some distros)

$ pip install file-thumbnailer
$ pip install file-thumbnailer[pdf] # for PyMuPDF support

Repository

You can also use these repositories maintained by me

Debian and derivates

Add repository by running these commands

$ wget -O- https://repository.salamek.cz/deb/salamek.gpg | sudo tee /usr/share/keyrings/salamek-archive-keyring.gpg
$ echo "deb     [signed-by=/usr/share/keyrings/salamek-archive-keyring.gpg] https://repository.salamek.cz/deb/pub all main" | sudo tee /etc/apt/sources.list.d/salamek.cz.list

And then you can install a package python3-file-thumbnailer

$ apt update && apt install python3-file-thumbnailer

Usage

from file_thumbnailer.ConverterManager import ConverterManager
from file_thumbnailer.models.Dimensions import Dimensions

converter_manager = ConverterManager()
with open('my_file.pdf', 'rb') as read_file:
    converter = converter_manager.from_data(read_file
    thumbnail = converter.to_image_bytes(Dimensions())
    with open('my_file_thumbnail.jpg', 'wb') as thumbnail_file:
        thumbnail_file.write(thumbnail)

Metadata

Release files for file-thumbnailer 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for file-thumbnailer 0.1.2
File Size Uploaded Provenance Actions
file-thumbnailer-0.1.2.tar.gz 243.0 kB Without provenance Details for file-thumbnailer-0.1.2.tar.gz

Release files / file-thumbnailer-0.1.2.tar.gz

Download URL file-thumbnailer-0.1.2.tar.gz
Size 243.0 kB
Tags Source
SHA-256 checksum
How to use checksums
9476044baff0b5dcc5b3953f8a52f24236f1e352f7fd0d4d540c6662a78ab0a7
BLAKE2b-256 checksum
How to use checksums
8e8d4f888cb42e874f7c5331c284263d6c649cc27966d15f571e3b325e05c7eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.2

Security for file-thumbnailer 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page