Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -22,21 +22,21 @@ for uploaded_file in uploaded_files:
|
|
22 |
uploaded_images[image_type][name].append(bytes_data)
|
23 |
st.image(bytes_data, use_column_width=True)
|
24 |
|
25 |
-
|
26 |
-
if uploaded_images['characters']:
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
if uploaded_images['terrain']:
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
|
|
22 |
uploaded_images[image_type][name].append(bytes_data)
|
23 |
st.image(bytes_data, use_column_width=True)
|
24 |
|
25 |
+
if image_type == 'characters':
|
26 |
+
if uploaded_images['characters']:
|
27 |
+
st.sidebar.write('**Characters**')
|
28 |
+
for name, files in uploaded_images['characters'].items():
|
29 |
+
for file in files:
|
30 |
+
st.sidebar.image(file, width=100, caption=name)
|
31 |
+
else:
|
32 |
+
if uploaded_images['terrain']:
|
33 |
+
st.write('**Terrain**')
|
34 |
+
row = []
|
35 |
+
for name, files in uploaded_images['terrain'].items():
|
36 |
+
for file in files:
|
37 |
+
row.append(file)
|
38 |
+
if len(row) == 3:
|
39 |
+
st.image(row, width=100 * 3)
|
40 |
+
row = []
|
41 |
+
if row:
|
42 |
+
st.image(row, width=100 * len(row)) # Last row, if not complete
|