Commits

Guilherme Gondim committed 91b5baa

migrate to imagekit 2.0.1

  • Participants
  • Parent commits 682f5ea

Comments (0)

Files changed (2)

galeria/models.py

 from django.utils.translation import ugettext_lazy as _
 
 from imagekit.models import ImageSpec
-from imagekit.processors import Transpose
-from imagekit.processors.resize import Crop, Fit
+from imagekit.processors import Anchor, ResizeToFill, ResizeToFit, Transpose
 from mptt.fields import TreeForeignKey
 from mptt.models import MPTTModel
 
 
 
 DISPLAY_IMAGE_PROCESSORS = getattr(settings, 'GALERIA_DISPLAY_IMAGE_PROCESSORS', [
-    Transpose(Transpose.AUTO), Fit(width=600, height=600)
+    Transpose(Transpose.AUTO),
+    ResizeToFit(width=600, height=600)
 ])
 THUMBNAIL_IMAGE_PROCESSORS = getattr(settings, 'GALERIA_THUMBNAIL_IMAGE_PROCESSORS', [
-    Transpose(Transpose.AUTO), Crop(width=128, height=128, anchor=Crop.CENTER)
+    Transpose(Transpose.AUTO),
+    ResizeToFill(width=128, height=128, anchor=Anchor.CENTER)
 ])
 COVER_IMAGE_PROCESSORS = getattr(settings, 'GALERIA_COVER_IMAGE_PROCESSORS', [
-    Transpose(Transpose.AUTO), Crop(width=128, height=128, anchor=Crop.CENTER)
+    Transpose(Transpose.AUTO),
+    ResizeToFill(width=128, height=128, anchor=Anchor.CENTER)
 ])
 
 ORDER_CHOICES = (
         DISPLAY_IMAGE_PROCESSORS,
         image_field='original_image',
         options={'quality': 90},
-        pre_cache=True
     )
     thumbnail_image = ImageSpec(
         THUMBNAIL_IMAGE_PROCESSORS,
         image_field='original_image',
         format='JPEG',
         options={'quality': 75},
-        pre_cache=True
     )
     cover_image = ImageSpec(
         COVER_IMAGE_PROCESSORS,
         image_field='original_image',
         format='JPEG',
         options={'quality': 75},
-        autoconvert=False
     )
     description = models.TextField(_('description'), blank=True)
     is_public = models.BooleanField(
         'Programming Language :: Python',
         'Topic :: Software Development :: Libraries :: Python Modules',
     ],
-    install_requires=['django-imagekit==1.1', 'FeinCMS==1.5.3']
+    install_requires=['django-imagekit>=2.0.1', 'django-mptt']
 )