Spaces:
Sleeping
Sleeping
| #!/usr/bin/env python3 | |
| """ | |
| Verify that all solar filter thumbnails are available, including the new composite filters. | |
| """ | |
| from pathlib import Path | |
| from PIL import Image | |
| print("πΌοΈ Verifying Solar Filter Thumbnails...") | |
| # Define all filters including the new composite ones | |
| all_filters = { | |
| "0193": "193 Γ - Coronal loops", | |
| "0304": "304 Γ - Chromosphere", | |
| "0171": "171 Γ - Quiet corona", | |
| "0211": "211 Γ - Active regions", | |
| "0131": "131 Γ - Flaring regions", | |
| "0335": "335 Γ - Active cores", | |
| "0094": "94 Γ - Hot plasma", | |
| "1600": "1600 Γ - Transition region", | |
| "1700": "1700 Γ - Temperature min", | |
| "094335193": "094+335+193 - Composite: Hot plasma + Active cores + Coronal loops", | |
| "304211171": "304+211+171 - Composite: Chromosphere + Active regions + Quiet corona", | |
| "211193171": "211+193+171 - Composite: Active regions + Coronal loops + Quiet corona" | |
| } | |
| ui_img_path = Path("src/ui_img") | |
| found_thumbnails = 0 | |
| missing_thumbnails = 0 | |
| print("\nπ Thumbnail Status:") | |
| for filter_num, description in all_filters.items(): | |
| # Look for thumbnail image | |
| thumbnail_files = list(ui_img_path.glob(f"*_{filter_num}.jpg")) | |
| if thumbnail_files: | |
| thumbnail_file = thumbnail_files[0] | |
| try: | |
| # Try to open the image to verify it's valid | |
| with Image.open(thumbnail_file) as img: | |
| width, height = img.size | |
| print(f"β {filter_num}: {thumbnail_file.name} ({width}x{height})") | |
| found_thumbnails += 1 | |
| except Exception as e: | |
| print(f"β {filter_num}: {thumbnail_file.name} (corrupted: {e})") | |
| missing_thumbnails += 1 | |
| else: | |
| print(f"β {filter_num}: No thumbnail found") | |
| missing_thumbnails += 1 | |
| print(f"\nπ Summary:") | |
| print(f"β Found: {found_thumbnails} thumbnails") | |
| print(f"β Missing: {missing_thumbnails} thumbnails") | |
| print(f"π Total: {len(all_filters)} filters") | |
| if missing_thumbnails == 0: | |
| print("\nπ All solar filter thumbnails are available!") | |
| print("The GUI will display visual previews for all filters including the new composite ones.") | |
| else: | |
| print(f"\nβ οΈ {missing_thumbnails} thumbnails are missing.") | |
| print("Missing filters will display as text buttons instead of image previews.") | |
| print("\nπ Thumbnail verification completed!") |