@@ -39,7 +39,15 @@ Installation
39
39
40
40
pip install django-image-cropping
41
41
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
43
51
44
52
45
53
Configuration
@@ -85,10 +93,11 @@ Backends
85
93
86
94
django-image-cropping delegates the cropped image generation to a backend.
87
95
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 .
89
97
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.
90
99
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
92
101
constructor params.
93
102
94
103
Default settings::
@@ -97,70 +106,6 @@ Default settings::
97
106
IMAGE_CROPPING_BACKEND_PARAMS = {}
98
107
99
108
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
-
164
109
Frontend
165
110
========
166
111
@@ -385,6 +330,11 @@ The cropping widget is not displayed when using a ``ForeignKey``.
385
330
Changelog
386
331
=========
387
332
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
+
388
338
1.0
389
339
---
390
340
0 commit comments