Spaces:
Running
Running
Update app2.py
Browse files
app2.py
CHANGED
|
@@ -157,6 +157,14 @@ def get_files_infos(files):
|
|
| 157 |
info["error"] = f"Error reading image metadata ({type(e).__name__})."
|
| 158 |
logging.warning(f"Error processing image '{info['original_name']}': {e}", exc_info=False)
|
| 159 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 160 |
else:
|
| 161 |
info["type"] = "unknown"
|
| 162 |
info["error"] = "Unsupported file type."
|
|
|
|
| 157 |
info["error"] = f"Error reading image metadata ({type(e).__name__})."
|
| 158 |
logging.warning(f"Error processing image '{info['original_name']}': {e}", exc_info=False)
|
| 159 |
|
| 160 |
+
# font
|
| 161 |
+
elif file_extension in (".ttf", ".otf", ".woff", ".woff2"):
|
| 162 |
+
info["type"] = "font"
|
| 163 |
+
|
| 164 |
+
elif file_extension in (".txt", ".csv", ".json",".srt", ".ass", ".vtt", ".sub", ".ssa"):
|
| 165 |
+
info["type"] = "text"
|
| 166 |
+
|
| 167 |
+
|
| 168 |
else:
|
| 169 |
info["type"] = "unknown"
|
| 170 |
info["error"] = "Unsupported file type."
|