Renamed feature detection setting to 'WAGTAILIMAGES_FEATURE_DETECTION_ENABLED'

pull/487/head
Karl Hobley 2014-07-23 11:28:32 +01:00
rodzic 5a8b92252f
commit c6e9123c9a
2 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -44,13 +44,13 @@ Switching on feature detection
Once OpenCV is installed, you need to switch on feature detection in Wagtail
You can do this by seting the ``WAGTAIL_FEATURE_DETECTION_ENABLED`` setting to ``True``:
You can do this by seting the ``WAGTAILIMAGES_FEATURE_DETECTION_ENABLED`` setting to ``True``:
.. code-block:: python
# settings.py
WAGTAIL_FEATURE_DETECTION_ENABLED = True
WAGTAILIMAGES_FEATURE_DETECTION_ENABLED = True
Feature detection runs when new images are uploaded in to Wagtail. If you already have images in your Wagtail site and would like to run feature detection on them, you will have to run it manually.

Wyświetl plik

@ -183,7 +183,7 @@ class Image(AbstractImage):
# Do smartcropping calculations when user saves an image without a focal point
@receiver(pre_save, sender=Image)
def image_feature_detection(sender, instance, **kwargs):
if getattr(settings, 'WAGTAIL_FEATURE_DETECTION_ENABLED', False):
if getattr(settings, 'WAGTAILIMAGES_FEATURE_DETECTION_ENABLED', False):
if not opencv_available:
raise ImproperlyConfigured("pyOpenCV could not be found.")