kopia lustrzana https://github.com/wagtail/wagtail
Renamed feature detection setting to 'WAGTAILIMAGES_FEATURE_DETECTION_ENABLED'
rodzic
5a8b92252f
commit
c6e9123c9a
|
@ -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.
|
||||
|
|
|
@ -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.")
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue