Commit 24714f90 by Simon Chen

LEARNER-1925 add the PIL setting to allow image of smaller size

parent 1dc97337
from django.apps import AppConfig from django.apps import AppConfig
from PIL import ImageFile
class CourseMetadataConfig(AppConfig): class CourseMetadataConfig(AppConfig):
...@@ -7,5 +8,9 @@ class CourseMetadataConfig(AppConfig): ...@@ -7,5 +8,9 @@ class CourseMetadataConfig(AppConfig):
def ready(self): def ready(self):
super(CourseMetadataConfig, self).ready() super(CourseMetadataConfig, self).ready()
# We need to add this setting because, since MM programs we are accepting banner
# images with height less than 480 max. In order to accept those images, we need
# to allow PIL to work with these images correctly by setting this variable true
ImageFile.LOAD_TRUNCATED_IMAGES = True
# noinspection PyUnresolvedReferences # noinspection PyUnresolvedReferences
import course_discovery.apps.course_metadata.signals # pylint: disable=unused-variable import course_discovery.apps.course_metadata.signals # pylint: disable=unused-variable
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment