Spaces:
Running
Running
Commit
•
6a78dda
1
Parent(s):
cc7c4ef
file upload gallery
Browse files
app.py
CHANGED
@@ -291,8 +291,8 @@ def save_uploaded_file(directory, img_file, image=None):
|
|
291 |
return full_path
|
292 |
else:
|
293 |
full_path = os.path.join(directory, img_file.name)
|
294 |
-
image.save(
|
295 |
-
return
|
296 |
|
297 |
def delete_directory(dir_path):
|
298 |
try:
|
@@ -1208,11 +1208,11 @@ def content_tab_settings():
|
|
1208 |
# Process the new iamges
|
1209 |
for uploaded_file in uploaded_files:
|
1210 |
file_path = save_uploaded_file(st.session_state['dir_uploaded_images'], uploaded_file)
|
|
|
|
|
1211 |
img = Image.open(file_path)
|
1212 |
img.thumbnail((64, 64), Image.Resampling.LANCZOS)
|
1213 |
file_path_small = save_uploaded_file(st.session_state['dir_uploaded_images_small'], uploaded_file, img)
|
1214 |
-
|
1215 |
-
st.session_state['input_list'].append(file_path)
|
1216 |
st.session_state['input_list_small'].append(file_path_small)
|
1217 |
print(uploaded_file.name)
|
1218 |
|
|
|
291 |
return full_path
|
292 |
else:
|
293 |
full_path = os.path.join(directory, img_file.name)
|
294 |
+
image.save(full_path, "JPEG")
|
295 |
+
return full_path
|
296 |
|
297 |
def delete_directory(dir_path):
|
298 |
try:
|
|
|
1208 |
# Process the new iamges
|
1209 |
for uploaded_file in uploaded_files:
|
1210 |
file_path = save_uploaded_file(st.session_state['dir_uploaded_images'], uploaded_file)
|
1211 |
+
st.session_state['input_list'].append(file_path)
|
1212 |
+
|
1213 |
img = Image.open(file_path)
|
1214 |
img.thumbnail((64, 64), Image.Resampling.LANCZOS)
|
1215 |
file_path_small = save_uploaded_file(st.session_state['dir_uploaded_images_small'], uploaded_file, img)
|
|
|
|
|
1216 |
st.session_state['input_list_small'].append(file_path_small)
|
1217 |
print(uploaded_file.name)
|
1218 |
|