easy-images

3 years after

Easy Images

Easy images for Django.

Processes a source image via a dictionary of options. For example, the following dictionary would resize the source image down and crop it to output a 64x64 image::

{'crop': (64, 64)}

Usage with Aliases

To make it easier to manage the different option dictionaries, it is recommended to define aliases that you can use to centralize all the image generation options in a single place.

In your settings::

EASY_IMAGES = {
    'ALIASES': {
        'smallbox': {'crop': (32, 32), 'upscale': True},
    },
}

Then to generate thumbs in a Django template just use::

<img src="{% image person.avatar alias 'smallbox' %}" alt="">

Or in Python, use::

from easy_images.aliases import aliases
from easy_images.images import EasyImage
EasyImage('some/file', aliases.get('smallbox')).generate()

See docs for details.

Related Repositories

official-images

official-images

Primary source of truth for the Docker "Official Images" program ...

grunt-responsive-images

grunt-responsive-images

Produce images at different sizes for responsive websites. ...

responsive-images.js

responsive-images.js

Lightweight plugin for easy responsive images replacement ...

easy-content-providers

easy-content-providers

Easy integration with Android's built-in and custom content providers data ...

android-multiple-images-selector

android-multiple-images-selector

Easy-to-use library to select images in Android application ...