Skip to main content

A very simple Django field to resize images at upload.

Project description

Django SizedImageField

What is it ?

SizedImageField is a Django field which will automatically resize image to fit a defined dimension. Because it inherits from ImageField, all the usual ImageField attributes are available. It uses PIL which is already a requirement to use Django ImageField.

Example

from sizedimagefield.fields import SizedImageField

class Article(models.Model):

    thumbnail = SizedImageField('thumbnail', width=150, height=150, upload_to='articles/')

Compatibilities

It has only been tested with Django 1.11 and Python 3.6.

Installation

Installing from pypi (using pip).

pip install django-sizedimagefield

Installing from github.

pip install -e git://github.com/makinacorpus/django-sizedimagefield.git#egg=django-sizedimagefield

Add sizedimagefield in your INSTALLED_APPS:

INSTALLED_APPS = [
    'sizedimagefield',
    [...]
]

The application doesn’t have any special requirement.

Licensing

Please see the LICENSE file.

Contacts

https://drupal.org/files/imagecache/grid-3/Logo_slogan_300dpi.png

CHANGELOG

0.1

** New **

  • Initial release

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-sizedimagefield-0.1.tar.gz (2.4 kB view details)

Uploaded Source

File details

Details for the file django-sizedimagefield-0.1.tar.gz.

File metadata

File hashes

Hashes for django-sizedimagefield-0.1.tar.gz
Algorithm Hash digest
SHA256 cfe9bc4787f77210b3855a8300e45bfeb8bf82aa9747fef492b5a77080cb236d
MD5 dab2c1a76409ed1b6f3302dd5a318a4a
BLAKE2b-256 ab36d3200cc4fddb28f55b82574846f7c2bad6ae0b9cd2a454efb3ce6355c558

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page