Ticket #8208: imagefieldfile.diff
File imagefieldfile.diff, 1009 bytes (added by , 16 years ago) |
---|
-
django/db/models/fields/files.py
273 273 ) 274 274 content = ContentFile(content) 275 275 276 super(ImageFieldFile, self).save(name, content, save) 277 276 278 # Repopulate the image dimension cache. 277 self._dimensions_cache = get_image_dimensions( content)279 self._dimensions_cache = get_image_dimensions(getattr(self.instance, self.field.name)) 278 280 279 281 # Update width/height fields, if needed 280 282 if self.field.width_field: 281 283 setattr(self.instance, self.field.width_field, self.width) 282 284 if self.field.height_field: 283 285 setattr(self.instance, self.field.height_field, self.height) 284 285 super(ImageFieldFile, self).save(name, content, save)286 286 287 287 def delete(self, save=True): 288 288 # Clear the image dimensions cache