def save_resized_background(background_image_file, event_id, size, image_sizes):
 width_ = 1300
 height_ = 500
 basewidth = image_sizes.full_width
 aspect = image_sizes.full_aspect
 height_size = image_sizes.full_height
 if (size == 'large'):
  width_ = 1300
  height_ = 500
  aspect = image_sizes.full_aspect
  basewidth = image_sizes.full_width
  height_size = image_sizes.full_height
 elif (size == 'thumbnail'):
  width_ = 500
  height_ = 200
  aspect = image_sizes.full_aspect
  basewidth = image_sizes.thumbnail_width
  height_size = image_sizes.thumbnail_height
 elif (size == 'icon'):
  width_ = 75
  height_ = 30
  aspect = image_sizes.icon_aspect
  basewidth = image_sizes.icon_width
  height_size = image_sizes.icon_height
 upload_path = UPLOAD_PATHS['event'][size].format(event_id=int(event_id))
 return save_resized_image(background_image_file, width_, height_, basewidth, aspect, height_size, upload_path)

def save_resized_background ( background_image_file , event_id , size , image_sizes ) : width_ = 1300 height_ = 500 basewidth = image_sizes . full_width aspect = image_sizes . full_aspect height_size = image_sizes . full_height if ( size == 'large' ) : width_ = 1300 height_ = 500 aspect = image_sizes . full_aspect basewidth = image_sizes . full_width height_size = image_sizes . full_height elif ( size == 'thumbnail' ) : width_ = 500 height_ = 200 aspect = image_sizes . full_aspect basewidth = image_sizes . thumbnail_width height_size = image_sizes . thumbnail_height elif ( size == 'icon' ) : width_ = 75 height_ = 30 aspect = image_sizes . icon_aspect basewidth = image_sizes . icon_width height_size = image_sizes . icon_height upload_path = UPLOAD_PATHS [ 'event' ] [ size ] . format ( event_id = int ( event_id ) ) return save_resized_image ( background_image_file , width_ , height_ , basewidth , aspect , height_size , upload_path )
save the resized version of the background image .