Skip to content

Commit b71ee0e

Browse files
committed
Update README
1 parent 1047160 commit b71ee0e

File tree

1 file changed

+17
-67
lines changed

1 file changed

+17
-67
lines changed

README.rst

Lines changed: 17 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,15 @@ Installation
3939

4040
pip install django-image-cropping
4141

42-
#. Configure the backend of your choice. By default the `easy-thumbnails`-backend is used which requires `easy-thumbnails` to also be installed.
42+
By default ``django-image-cropping`` ships with an ``easy-thumbnails``-backend which requires ``easy-thumbnails`` to also be installed
43+
and added to the ``INSTALLED_APPS``.
44+
45+
The `easy-thumbnails` backend requires that you adjust the thumbnail processors in your ``settings``::
46+
47+
from easy_thumbnails.conf import Settings as thumbnail_settings
48+
THUMBNAIL_PROCESSORS = (
49+
'image_cropping.thumbnail_processors.crop_corners',
50+
) + thumbnail_settings.THUMBNAIL_PROCESSORS
4351

4452

4553
Configuration
@@ -85,10 +93,11 @@ Backends
8593

8694
django-image-cropping delegates the cropped image generation to a backend.
8795

88-
There are two built-in backends, but it is possible to provide custom backends.
96+
A backend based on `easy-thumbnails` is provided, but it's possible to use a custom backend.
8997
The ``IMAGE_CROPPING_BACKEND`` setting expects a dotted path to a class that implements the required methods.
98+
You can omit this setting if you want to use the default backend.
9099

91-
You can provide an optional dict that will be used to populate the backend's
100+
In case you use a custom backend you can provide an optional dict that will be used to populate the backend's
92101
constructor params.
93102

94103
Default settings::
@@ -97,70 +106,6 @@ Default settings::
97106
IMAGE_CROPPING_BACKEND_PARAMS = {}
98107

99108

100-
easy_thumbnails
101-
---------------
102-
103-
A backend for the `easy_thumbnails <https://github.com/SmileyChris/easy-thumbnails>`_
104-
package.
105-
106-
#. If you haven't installed ``easy_thumbnails`` already, install it::
107-
108-
pip install easy_thumbnails
109-
110-
#. Add ``easy_thumbnails`` to your ``INSTALLED_APPS``.
111-
112-
#. Adjust the thumbnail processors for ``easy-thumbnails`` in your ``settings``::
113-
114-
from easy_thumbnails.conf import Settings as thumbnail_settings
115-
THUMBNAIL_PROCESSORS = (
116-
'image_cropping.thumbnail_processors.crop_corners',
117-
) + thumbnail_settings.THUMBNAIL_PROCESSORS
118-
119-
120-
django-filebrowser
121-
------------------
122-
123-
A backend for the `django-filebrowser <https://github.com/sehmaschine/django-filebrowser>`_
124-
package.
125-
126-
#. If you haven't installed ``django-filebrowser`` already, install it::
127-
128-
pip install django-filebrowser
129-
130-
#. Add ``django-filebrowser`` and ``grappelli`` to your ``INSTALLED_APPS`` (before django.contrib.admin)::
131-
132-
INSTALLED_APPS = (
133-
'grappelli',
134-
'filebrowser',
135-
'django.contrib.admin',
136-
)
137-
138-
#. Add the ``django-filebrowser`` site to your url-patterns (before any admin-urls)::
139-
140-
from filebrowser.sites import site
141-
142-
urlpatterns = [
143-
url(r'^admin/filebrowser/', include(site.urls)),
144-
url(r'^grappelli/', include('grappelli.urls')),
145-
url(r'^admin/', include(admin.site.urls)),
146-
]
147-
148-
149-
#. Change the ``IMAGE_CROPPING_BACKEND`` in your ``settings``::
150-
151-
IMAGE_CROPPING_BACKEND = 'image_cropping.backends.fb.FileBrowserBackend'
152-
153-
# specify a custom version suffix
154-
# IMAGE_CROPPING_BACKEND_PARAMS = {'version_suffix': 'crop'}
155-
156-
157-
#. Adjust the image processors for ``django-filebrowser`` in your ``settings``::
158-
159-
FILEBROWSER_PROCESSORS = (
160-
'image_cropping.thumbnail_processors.crop_corners',
161-
'filebrowser.utils.scale_and_crop',
162-
)
163-
164109
Frontend
165110
========
166111

@@ -385,6 +330,11 @@ The cropping widget is not displayed when using a ``ForeignKey``.
385330
Changelog
386331
=========
387332

333+
1.1 (unreleased)
334+
----------------
335+
336+
- Move and encapsulate the logic for creating cropped thumbnails to a swappable backend. (`@fgmacedo <https://github.com/fgmacedo>`_ in #92)
337+
388338
1.0
389339
---
390340

0 commit comments

Comments
 (0)