zc-huhu commited on
Commit
5705ac4
·
1 Parent(s): 67557f4
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -69,6 +69,8 @@ def load_header(header_file):
69
  return content
70
 
71
  def preprocess_img(img_path, max_size=1024):
 
 
72
  img = Image.open(img_path)
73
  if max(img.size) > max_size:
74
  img.thumbnail((max_size, max_size))
 
69
  return content
70
 
71
  def preprocess_img(img_path, max_size=1024):
72
+ if img_path is None:
73
+ return None
74
  img = Image.open(img_path)
75
  if max(img.size) > max_size:
76
  img.thumbnail((max_size, max_size))