Spaces:
Sleeping
Sleeping
Richard Young
Claude
commited on
Commit
·
d31350b
1
Parent(s):
d658499
Fix 'too many values to unpack' error in corruption checker
Browse files- diagnose_image_issue returns tuple (error_type, details), not dict
- Updated to properly unpack the tuple
- Fixed iteration logic to display error info correctly
- Fixes runtime error in Check Corruption tab
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
app.py
CHANGED
|
@@ -272,8 +272,8 @@ def check_image_corruption(image, sensitivity, check_visual):
|
|
| 272 |
check_visual=check_visual
|
| 273 |
)
|
| 274 |
|
| 275 |
-
# Get diagnostic details
|
| 276 |
-
|
| 277 |
|
| 278 |
# Clean up
|
| 279 |
os.unlink(image_path)
|
|
@@ -301,9 +301,9 @@ The image passed all validation checks:
|
|
| 301 |
The image has validation problems:
|
| 302 |
|
| 303 |
"""
|
| 304 |
-
if
|
| 305 |
-
|
| 306 |
-
|
| 307 |
else:
|
| 308 |
result += "❌ Image failed validation but no specific issues identified.\n\n"
|
| 309 |
|
|
|
|
| 272 |
check_visual=check_visual
|
| 273 |
)
|
| 274 |
|
| 275 |
+
# Get diagnostic details (returns tuple: error_type, details)
|
| 276 |
+
error_type, error_details = find_bad_images.diagnose_image_issue(image_path)
|
| 277 |
|
| 278 |
# Clean up
|
| 279 |
os.unlink(image_path)
|
|
|
|
| 301 |
The image has validation problems:
|
| 302 |
|
| 303 |
"""
|
| 304 |
+
if error_type and error_details:
|
| 305 |
+
result += f"**Issue Type:** {error_type}\n\n"
|
| 306 |
+
result += f"**Details:** {error_details}\n\n"
|
| 307 |
else:
|
| 308 |
result += "❌ Image failed validation but no specific issues identified.\n\n"
|
| 309 |
|