Spaces:
Sleeping
Sleeping
Update utils.py
Browse files
utils.py
CHANGED
|
@@ -287,4 +287,23 @@ def format_statistics_text(stats):
|
|
| 287 |
🟡 Low: {stats['low']} reports
|
| 288 |
|
| 289 |
**Average items per report:** {stats['items']/stats['total']:.1f}
|
| 290 |
-
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 287 |
🟡 Low: {stats['low']} reports
|
| 288 |
|
| 289 |
**Average items per report:** {stats['items']/stats['total']:.1f}
|
| 290 |
+
"""
|
| 291 |
+
import exifread
|
| 292 |
+
|
| 293 |
+
def dump_exif_tags(image_path):
|
| 294 |
+
"""Return all EXIF tags from the image as a formatted string for debugging"""
|
| 295 |
+
tags_text = []
|
| 296 |
+
try:
|
| 297 |
+
with open(image_path, "rb") as f:
|
| 298 |
+
tags = exifread.process_file(f, details=False)
|
| 299 |
+
|
| 300 |
+
if not tags:
|
| 301 |
+
return "⚠ No EXIF data found."
|
| 302 |
+
|
| 303 |
+
for tag, value in tags.items():
|
| 304 |
+
tags_text.append(f"{tag}: {value}")
|
| 305 |
+
|
| 306 |
+
except Exception as e:
|
| 307 |
+
return f"❌ Failed to read EXIF: {e}"
|
| 308 |
+
|
| 309 |
+
return "\n".join(tags_text)
|