Resizes image origin to specified size.
Project description
Resizes image origin to specified size. Compatible with sorl-thumbnail.
Features
Support for Django 1.3, 1.4, 1.5, 1.6 and 1.7
Python 3 support
Installation
pip install django-resized
Configuration (optional)
settings.py
DJANGORESIZED_DEFAULT_SIZE = [1920, 1080] DJANGORESIZED_DEFAULT_QUALITY = 75 DJANGORESIZED_DEFAULT_KEEP_META = True
Usage
models.py
from django_resized import ResizedImageField
class MyModel(models.Model):
...
image1 = ResizedImageField(size=[500, 300], upload_to='whatever')
image2 = ResizedImageField(size=[100, 100], crop=['top', 'left'], upload_to='whatever')
image3 = ResizedImageField(size=[100, 100], crop=['middle', 'center'], upload_to='whatever')
image4 = ResizedImageField(size=[500, 300], quality=75, upload_to='whatever')
Options
size - max width and height, for example [640, 480]
crop - resize and crop. [‘top’, ‘left’] - top left corner, [‘middle’, ‘center’] is center cropping, [‘bottom’, ‘right’] - crop right bottom corner.
quality - quality of resized image 1..100
keep_meta - keep EXIF and other meta data, default True
How to run tests
tox
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django-resized-0.3.5.tar.gz
(3.0 kB
view details)
File details
Details for the file django-resized-0.3.5.tar.gz.
File metadata
- Download URL: django-resized-0.3.5.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
501db54d74127143726790816d1e09e7c5305727a4eda48f85282d850fdccc2c
|
|
| MD5 |
741bc8998ce665675c3bed4ebde58e7c
|
|
| BLAKE2b-256 |
9e4638d6cb24f8fdb457ad5863aa25633aca0bf030253dd6bb32d02a822cbe93
|