Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -139,9 +139,9 @@ def file_anzeigen(file):
|
|
139 |
print("ext...............................")
|
140 |
print(ext)
|
141 |
if (ext == "png" or ext == "PNG" or ext == "jgp" or ext == "jepg"):
|
142 |
-
return gr.Image(width=47, visible=True, interactive = False, height=47, min_width=47, show_label=False,
|
143 |
else:
|
144 |
-
return gr.Image(width=47, visible=True, interactive = False, height=47, min_width=47, show_label=False, scale = 0.5), "data/file.png", file
|
145 |
|
146 |
def file_loeschen():
|
147 |
return None, gr.Image(visible = False)
|
@@ -163,11 +163,6 @@ def umwandeln_fuer_anzeige(image):
|
|
163 |
image.save(buffer, format='PNG')
|
164 |
return buffer.getvalue()
|
165 |
|
166 |
-
#########################################
|
167 |
-
#Extension des hochgeladenen Files bestimmen
|
168 |
-
def analyze_file(file):
|
169 |
-
file_extension = file.name.split('.')[-1] # Holen Sie sich die Dateiendung
|
170 |
-
return file_extension
|
171 |
|
172 |
|
173 |
##########################################
|
|
|
139 |
print("ext...............................")
|
140 |
print(ext)
|
141 |
if (ext == "png" or ext == "PNG" or ext == "jgp" or ext == "jepg"):
|
142 |
+
return gr.Image(width=47, visible=True, interactive = False, height=47, min_width=47, show_label=False, show_share_button=False, show_download_button=False, show_scale = 0.5), file, file
|
143 |
else:
|
144 |
+
return gr.Image(width=47, visible=True, interactive = False, height=47, min_width=47, show_label=False, show_share_button=False, show_download_button=False, scale = 0.5), "data/file.png", file
|
145 |
|
146 |
def file_loeschen():
|
147 |
return None, gr.Image(visible = False)
|
|
|
163 |
image.save(buffer, format='PNG')
|
164 |
return buffer.getvalue()
|
165 |
|
|
|
|
|
|
|
|
|
|
|
166 |
|
167 |
|
168 |
##########################################
|