Commits

Luka Čehovin committed 386d140 Draft

Updating PhotoProfile for new version of imagekit

Comments (0)

Files changed (1)

profiles/models.py

   from imagekit.processors.crop import *
   from imagekit.processors.resize import *
 
-  PROFILE_PHOTO_BIG = [Transpose(Transpose.AUTO), Crop(width=128, height=128, anchor=Crop.CENTER)]
-  PROFILE_PHOTO_MEDIUM = [Transpose(Transpose.AUTO), Crop(width=64, height=64, anchor=Crop.CENTER)]
-  PROFILE_PHOTO_SMALL = [Transpose(Transpose.AUTO), Crop(width=32, height=32, anchor=Crop.CENTER)]
+  PROFILE_PHOTO_BIG = [Transpose(Transpose.AUTO), Crop(width=128, height=128, anchor=Anchor.CENTER)]
+  PROFILE_PHOTO_MEDIUM = [Transpose(Transpose.AUTO), Crop(width=64, height=64, anchor=Anchor.CENTER)]
+  PROFILE_PHOTO_SMALL = [Transpose(Transpose.AUTO), Crop(width=32, height=32, anchor=Anchor.CENTER)]
 
   class PhotoProfile(models.Model):
     class Meta:
     user = models.OneToOneField(User)
 
     profile_photo = models.ImageField(upload_to=getattr(settings, 'PROFILE_PHOTO_DIRECTORY', 'profile'), blank=True)
-    profile_photo_big = ImageSpec(getattr(settings, 'PROFILE_PHOTO_BIG', PROFILE_PHOTO_BIG), image_field='profile_photo', options={'quality': 90}, pre_cache=True)
-    profile_photo_medium = ImageSpec(getattr(settings, 'PROFILE_PHOTO_MEDIUM', PROFILE_PHOTO_MEDIUM), image_field='profile_photo', options={'quality': 90}, pre_cache=True)
-    profile_photo_small = ImageSpec(getattr(settings, 'PROFILE_PHOTO_SMALL', PROFILE_PHOTO_SMALL), image_field='profile_photo', options={'quality': 90}, pre_cache=True)
+    profile_photo_big = ImageSpec(getattr(settings, 'PROFILE_PHOTO_BIG', PROFILE_PHOTO_BIG), image_field='profile_photo', options={'quality': 90})
+    profile_photo_medium = ImageSpec(getattr(settings, 'PROFILE_PHOTO_MEDIUM', PROFILE_PHOTO_MEDIUM), image_field='profile_photo', options={'quality': 90})
+    profile_photo_small = ImageSpec(getattr(settings, 'PROFILE_PHOTO_SMALL', PROFILE_PHOTO_SMALL), image_field='profile_photo', options={'quality': 90})
 
 except ImportError, e: 
   print e