docs: def save(self, file_or_wfs, filename=None, bbox=None, overwrite=None):
          '''Save a Werkzeug FileStorage object'''
          self._mark_as_changed()
          override = filename is not None
          filename = filename or getattr(file_or_wfs, 'filename')
  
          if self.basename and not override:
              basename = self.basename(self._instance)
          elif filename:
              basename = splitext(filename)[0]
          else:
              raise ValueError('Filename is required')
  
          ext = extension(filename)
          prefix = self.upload_to(self._instance) if callable(self.upload_to) else self.upload_to
          kwargs = {'prefix': prefix, 'overwrite': overwrite}
  
          if self.optimize is not None:
              should_optimize = self.optimize
          else:
              should_optimize = current_app.config['FS_IMAGES_OPTIMIZE']
  
          def name(size=None):
              if size:
                  return '.'.join(['-'.join([basename, str(size)]), ext])
              else:
                  return '.'.join([basename, ext])
  
          if self.max_size:
              resized = resize(file_or_wfs, self.max_size)
              file_or_wfs.seek(0)
              if resized:
                  self.original = self.fs.save(file_or_wfs, name('original'), **kwargs)
                  self.filename = self.fs.save(resized, name(), **kwargs)
              else:
                  self.filename = self.fs.save(file_or_wfs, name(), **kwargs)
          elif should_optimize:
              optimized = optimize(file_or_wfs)
              file_or_wfs.seek(0)
              self.original = self.fs.save(file_or_wfs, name('original'), **kwargs)
              self.filename = self.fs.save(optimized, name(), **kwargs)
          else:
              self.filename = self.fs.save(file_or_wfs, name(), **kwargs)
  
          if self.thumbnail_sizes:
              self.bbox = bbox
              for size in self.thumbnail_sizes:
                  file_or_wfs.seek(0)
                  thumbnail = make_thumbnail(file_or_wfs, size, self.bbox)
                  self.thumbnails[str(size)] = self.fs.save(FileStorage(thumbnail),
                                                            name(size),
                                                            **kwargs)
          return self.filename