Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Easy Thumbnails

The powerful, yet easy to implement thumbnailing application for Django.

To install this application into your project, just add it to your INSTALLED_APPS setting (and run manage.py syncdb):

INSTALLED_APPS = (
    ...
    'easy_thumbnails',
)

Template usage

To generate thumbnails in your template, use the {% thumbnail %} tag. To make this tag available for use in your template, use:

{% load thumbnail %}

Basic tag Syntax:

{% thumbnail [source] [size] [options] %}

source must be a File object, usually an Image/FileField of a model instance.

size can either be:

  • the size in the format [width]x[height] (for example, {% thumbnail person.photo 100x50 %}) or

  • a variable containing a valid size (i.e. either a string in the [width]x[height] format or a tuple containing two integers): {% thumbnail person.photo size_var %}.

options are a space separated list of options which are used when processing the image to a thumbnail such as sharpen, crop and quality=90.

Model usage

You can use the ThumbnailerField or ThumbnailerImageField fields (based on FileField and ImageField, respectively) for easier access to retrieve (or generate) thumbnail images.

By passing a resize_source argument to the ThumbnailerImageField, you can resize the source image before it is saved:

class Profile(models.Model):
    user = models.ForeignKey('auth.User')
    avatar = ThumbnailerImageField(
        upload_to='avatars',
        resize_source=dict(size=(50, 50), crop='smart'),
    )

Lower level usage

Thumbnails are generated with a Thumbnailer instance. Usually you’ll use the get_thumbnailer method to generate one of these, for example:

from easy_thumbnails.files import get_thumbnailer

def square_thumbnail(source):
    thumbnail_options = dict(size=(100, 100), crop=True, bw=True)
    return get_thumbnailer(source).get_thumbnail(thumbnail_options)

See the docs directory for more comprehensive usage documentation.

Metadata

Release files for easy-thumbnails 1.0-alpha-20

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

Source distribution (sdist)

Source distribution for easy-thumbnails 1.0-alpha-20
File Size Uploaded Provenance Actions
easy-thumbnails-1.0-alpha-20.tar.gz 40.6 kB Without provenance Details for easy-thumbnails-1.0-alpha-20.tar.gz

Release files / easy-thumbnails-1.0-alpha-20.tar.gz

Download URL easy-thumbnails-1.0-alpha-20.tar.gz
Size 40.6 kB
Tags Source
SHA-256 checksum
How to use checksums
ccdb1b7b0ab070acbb2a37bfab43f9422608b2316b876e04a859a91e79a4271e
BLAKE2b-256 checksum
How to use checksums
dffe0f51bfe0fed0b151bcae6a50807c83555d28e249b3fdf8f46edc0e4001fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for easy-thumbnails 1.0-alpha-20

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.

Release history Release notifications | RSS feed

This release
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