Commits

George Notaras committed a2428c9

Fixed the EnhancedImageFieldFile constructor to support thumbnail options

  • Participants
  • Parent commits 3f02348

Comments (0)

Files changed (1)

File src/thumbnail_works/fields.py

         if self._options_are_valid(options):
             self.options = options
         
-        self.size = options['size']
+        self.size = options['size'] # size in the formn WIDTHxHEIGHT
         self.width, self.height = get_width_height_from_string(self.size)
         self.url = make_thumbnail_path(source.url, self.name)
     
+    # Private API
+    
     def _get_name(self, name):
         return name.replace(' ', '_')
     
         # exist and the source image has been saved.
         if self._committed and self.field.thumbnails:
             for thumb_name, thumb_options in self.field.thumbnails.items():
-                
                 thumb_obj = Thumbnail(thumb_name, thumb_options, self)
-                thumb_size = thumb_options['size']
                 setattr(self, thumb_name, thumb_obj)
     
     def save(self, name, content, save=True):