mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-04-10 13:02:59 +00:00
3.0 KiB
3.0 KiB
Broadcast Logo Analyzer
This script analyzes broadcast channel logos to ensure we have proper logos for every game and identifies missing or problematic logos that might show as white boxes.
Important Notes
This script must be run on the Raspberry Pi where the LEDMatrix project is located, as it needs to access the actual logo files in the assets/broadcast_logos/ directory.
Usage
On Raspberry Pi (Recommended)
# SSH into your Raspberry Pi
ssh pi@your-pi-ip
# Navigate to the LEDMatrix project directory
cd /path/to/LEDMatrix
# Run the analyzer
python test/analyze_broadcast_logos.py
Local Testing (Optional)
If you want to test the script logic locally, you can:
- Copy some logo files from your Pi to your local machine
- Place them in
assets/broadcast_logos/directory - Run the script locally
What the Script Does
- Checks Logo Mappings: Verifies all broadcast channel names in
BROADCAST_LOGO_MAPhave corresponding logo files - Validates File Existence: Ensures all referenced logo files actually exist
- Analyzes Logo Quality:
- Checks dimensions (too small/large)
- Analyzes transparency handling
- Detects potential white box issues
- Measures content density
- Identifies Issues:
- Missing logos
- Problematic logos (corrupted, too transparent, etc.)
- Orphaned logo files (exist but not mapped)
- Generates Report: Creates both console output and JSON report
Output
The script generates:
- Console Report: Detailed analysis with recommendations
- JSON Report:
test/broadcast_logo_analysis.jsonwith structured data
Common Issues Found
- White Boxes: Usually caused by:
- Missing logo files
- Corrupted image files
- Images that are mostly transparent
- Images with very low content density
- Missing Logos: Broadcast channels that don't have corresponding logo files
- Orphaned Logos: Logo files that exist but aren't mapped to any broadcast channel
Recommendations
The script provides specific recommendations for each issue found, such as:
- Adding missing logo files
- Fixing problematic logos
- Optimizing logo dimensions
- Ensuring proper transparency handling
Example Output
BROADCAST LOGO ANALYSIS REPORT
================================================================================
SUMMARY:
Total broadcast mappings: 44
Existing logos: 40
Missing logos: 2
Problematic logos: 2
Orphaned logos: 1
MISSING LOGOS (2):
--------------------------------------------------
New Channel -> newchannel.png
Expected: /path/to/LEDMatrix/assets/broadcast_logos/newchannel.png
PROBLEMATIC LOGOS (2):
--------------------------------------------------
ESPN -> espn
Issue: Very low content density: 2.1%
Recommendation: Logo may appear as a white box - check content
Troubleshooting
If you see errors about missing dependencies:
pip install Pillow
If the script can't find the broadcast logos directory, ensure you're running it from the LEDMatrix project root directory.