code: def pre_save(self, model_instance, add):
          
          file = getattr(model_instance, self.attname)
          if file and not file._committed:
              file.name = self._clean_file_name(model_instance, file.name)
              file.file = self._resize_image(model_instance, file)
              file.save(file.name, file, save=False)
          return file
docs: Resizes, commits image to storage, and returns field's value just before saving.