Anonymous avatar Anonymous committed e412954

Renamed IKConfig inner class to IKOptions to be consistent and added ImageFile.MAXBLOCK setting

Comments (0)

Files changed (2)

src/imagekit/__init__.py

 Version: 1.0
 
 """
-VERSION = (1, 0)
+VERSION = (1, 0, 'pre')
 
 
 

src/imagekit/models.py

 from imagekit.options import Options
 from imagekit.utils import img_to_fobj
 
+# Modify image file buffer size.
+ImageFile.MAXBLOCK = getattr(settings, 'PIL_IMAGEFILE_MAXBLOCK', 256 * 2 ** 10)
+
 
 class IKModelBase(ModelBase):
     def __init__(cls, name, bases, attrs):
         parents = [b for b in bases if isinstance(b, IKModelBase)]
         if not parents:
             return
-        user_opts = getattr(cls, 'IKConfig', None)
+        user_opts = getattr(cls, 'IKOptions', None)
         opts = Options(user_opts)
         try:
             module = __import__(opts.spec_module,  {}, {}, [''])
 class IKModel(models.Model):
     """ Abstract base class implementing all core ImageKit functionality
     
-    Subclasses of IKModel can override the inner IKConfig class to customize
+    Subclasses of IKModel can override the inner IKOptions class to customize
     storage locations and other options.
     
     """
     class Meta:
         abstract = True
         
-    class IKConfig:
+    class IKOptions:
         pass
         
     def admin_thumbnail_view(self):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.