Skip to main content

A Django app for fetching resized and/or cropped images through a url.

Project description

Django Resizer
==============

Django Resizer allows images to be dynamically resized and/or cropped through a URL. This is very useful when you have a third-party "hot-linking" your images and they won't have access to template tag to dynamically resize images like [easy-thumbnails](https://github.com/SmileyChris/easy-thumbnails) or [sorl-thumbnail](https://github.com/sorl/sorl-thumbnail) provides.

Installation
------------

Run `pip install django-resizer`

Add `resizer` to your `INSTALLED_APPS` setting:

```python
INSTALLED_APPS = (
...
'resizer',
)
```

To your sites `url.py` add:

```python
urlpatterns = patterns('',
...
url(r'^resizer/(?P<path>.*)/$', 'resizer.views.resize', name='image_resize'),
)
```

Usage
-----

The resizing and cropping capabilities rely on the easy-thumbnails app.

To resize an image with a height and width of no more than 50px and with the image ratio perserved:

`/resizer/images/picture.jpg?size=50,50`

The path after `/resizer` should be the path to the image from your settings `MEDIA_ROOT`. The query string should be `size=[width],[height]`.

To resize an image to have a height and width of extactly 50px:

`/resizer/images/picture.jpg?size=50,50&crop=smart`

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-resizer-0.1.1a5.zip (6.9 kB view details)

Uploaded Source

File details

Details for the file django-resizer-0.1.1a5.zip.

File metadata

  • Download URL: django-resizer-0.1.1a5.zip
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for django-resizer-0.1.1a5.zip
Algorithm Hash digest
SHA256 700eb762431b92ccad79dcfd1fc56a4cd8b49acdc58f33d061849818050d4944
MD5 c628fcfca2192f39d12a89804bf66628
BLAKE2b-256 2055afd9c5489adeafce4a630c6b6b97698fb4cffc64558300aabec22acb89c0

See more details on using hashes here.

Supported by

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