def save(self, name, content, save=True): new_filename = generate_filename_and_delete_previous(self, name) super(ImageFieldFile, self).save(new_filename, content, save) # Create associated scaled thumbnail image t_name = self.thumbnail_name() if t_name: thumb_file = scale_image(self.storage.open(new_filename), (self.field.thumb_max_width, self.field.thumb_max_height)) self.storage.save(t_name, thumb_file)
def save(self, name, content, save=True): new_filename = generate_filename_and_delete_previous(self, name) super(ImageFieldFile, self).save(new_filename, content, save) # Create associated scaled thumbnail image t_name = self.thumbnail_name() if t_name: thumb_file = scale_image( self.storage.open(new_filename), (self.field.thumb_max_width, self.field.thumb_max_height)) self.storage.save(t_name, thumb_file)
def save(self, name, content, save=True): new_filename = generate_filename_and_delete_previous(self, name) super(ReplacingFieldZipFile, self).save(new_filename, content, save)