Troubleshooting
This guide helps you diagnose and resolve common issues when using the GUI application.
Quick Diagnosis
Application Won't Start
- Check system requirements: Ensure your platform is supported
- Verify dependencies: Install required system libraries
- Try debug mode: Run with
RUST_LOG=debug
for detailed output - Check permissions: Ensure the executable has proper permissions
Generation Fails
- Verify file paths: Ensure all selected files and directories exist
- Check material directory: Confirm it contains supported image files
- Enable verbose logging: Get detailed error information
- Try simpler settings: Reduce complexity to isolate issues
Poor Performance
- Use release builds: Debug builds are 3-5x slower
- Reduce settings: Lower tile counts and material limits
- Free system resources: Close other applications
- Check system specifications: Ensure adequate RAM and CPU
Common Issues and Solutions
Installation and Setup Issues
GUI Application Won't Launch
Symptoms:
- Application fails to start
- Error message about missing libraries
- Immediate crash on startup
Solutions:
Linux:
# Install required GTK dependencies
sudo apt-get install libgtk-3-dev libxdo-dev
# For Fedora/RHEL
sudo dnf install gtk3-devel libxdo-devel
# For Arch Linux
sudo pacman -S gtk3 xdotool
macOS:
# Install Xcode command line tools
xcode-select --install
# Verify macOS version (10.15+ required)
sw_vers
Windows:
- Ensure Windows 10 or later
- Try running as administrator
- Check Windows Defender/antivirus settings
Build Errors
Symptoms:
cargo build
fails with compilation errors- Missing dependencies during build
- Platform-specific build issues
Solutions:
# Update Rust toolchain
rustup update
# Clean build cache
cargo clean
# Rebuild with verbose output
cargo build --bin mosaic-gui --verbose
# Check for specific error messages
cargo check --bin mosaic-gui
File Selection Issues
File Dialog Doesn't Appear
Symptoms:
- Clicking "Browse" buttons has no effect
- File dialogs appear but are empty
- Cannot select files or directories
Solutions:
- Check permissions: Ensure the application has file system access
- Try different directories: Test with directories you own
- Restart application: Sometimes helps with dialog issues
- Check file paths: Ensure no special characters in paths
Invalid File Path Errors
Symptoms:
- Error messages about invalid file paths
- Files selected but not recognized
- Directory selection fails
Solutions:
- Verify file existence: Ensure files haven't been moved or deleted
- Check file permissions: Ensure files are readable
- Avoid special characters: Use simple filenames without spaces or symbols
- Try different locations: Test with files in different directories
Material Directory Issues
No Material Images Found
Symptoms:
- Error: "No material images found in the specified directory"
- Generation fails immediately
- Empty material directory warnings
Solutions:
- Verify file formats: Ensure images are PNG, JPG, or JPEG
- Check directory contents: Confirm directory isn't empty
- File extensions: Ensure proper file extensions (.png, .jpg, .jpeg)
- Subdirectories: Materials must be in the root of selected directory
Material Loading Errors
Symptoms:
- Some materials fail to load
- Warnings about corrupted images
- Inconsistent material counts
Solutions:
- Check image integrity: Verify images aren't corrupted
- Consistent formats: Use consistent image formats
- File size limits: Very large images may cause issues
- Enable verbose logging: Get detailed error information
Generation Process Issues
Out of Memory Errors
Symptoms:
- Application crashes during generation
- System becomes unresponsive
- "Out of memory" error messages
Solutions:
- Reduce tile count: Use fewer total tiles
- Limit materials: Reduce max materials setting
- Smaller images: Use lower resolution material images
- Close other apps: Free up system memory
- Check system RAM: Ensure adequate memory available
Slow Processing
Symptoms:
- Generation takes extremely long
- Progress bar moves very slowly
- System becomes sluggish
Solutions:
Use release builds:
bashcargo build --bin mosaic-gui --release ./target/release/mosaic-gui
Reduce settings:
- Lower total tiles (500-1000)
- Reduce max materials (200-500)
- Disable optimization for testing
- Reduce optimization iterations
System optimization:
- Close unnecessary applications
- Ensure adequate free disk space
- Monitor system resources
Generation Hangs
Symptoms:
- Progress bar stops updating
- Application becomes unresponsive
- No error messages or logs
Solutions:
- Enable verbose logging: Get detailed progress information
- Check system resources: Monitor CPU and memory usage
- Restart application: Force close and restart
- Reduce complexity: Try simpler settings first
Quality and Results Issues
Poor Mosaic Quality
Symptoms:
- Blurry or pixelated results
- Colors don't match target image
- Obvious repetition patterns
Solutions:
- Increase tile count: Use more tiles for better detail
- Improve materials: Use higher quality, more diverse images
- Adjust color settings: Increase color adjustment strength
- Enable optimization: Use optimization for better patterns
Repetitive Patterns
Symptoms:
- Same tiles appear frequently
- Obvious clustering of similar tiles
- Unnatural-looking patterns
Solutions:
- Increase material variety: Use more diverse material images
- Adjust usage limits: Reduce max usage per image
- Enable adjacency penalty: Increase adjacency penalty weight
- Enable optimization: Use optimization to improve patterns
Color Mismatches
Symptoms:
- Tiles don't match target colors well
- Mosaic looks too different from original
- Artificial-looking color combinations
Solutions:
- Increase color adjustment: Use higher color adjustment values
- Better material selection: Use materials with colors similar to target
- More materials: Increase max materials for better matching
- Check material diversity: Ensure wide range of colors in materials
Interface Issues
Theme Problems
Symptoms:
- Theme doesn't switch properly
- Colors appear wrong
- Text hard to read
Solutions:
- Restart application: Theme changes may require restart
- Check system theme: Ensure system theme is compatible
- Try different theme: Switch between light and dark modes
- Update system: Ensure OS is up to date
Log Display Issues
Symptoms:
- Logs don't appear
- Log text is truncated
- Cannot scroll through logs
Solutions:
- Enable verbose logging: Ensure logging is enabled
- Scroll manually: Use scrollbar to navigate logs
- Resize window: Make window larger to see more logs
- Clear logs: Restart application to clear old logs
Advanced Debugging
Enable Debug Mode
For detailed debugging information:
# Linux/macOS
RUST_LOG=debug ./target/release/mosaic-gui
# Windows (PowerShell)
$env:RUST_LOG="debug"
./target/release/mosaic-gui.exe
# Windows (Command Prompt)
set RUST_LOG=debug
./target/release/mosaic-gui.exe
Understanding Fallback Logging (Added 2025-01-11)
The GUI includes a comprehensive fallback system that ensures no grid cells remain empty. When Verbose logging is enabled, you can monitor this system's activity:
Normal Operation:
- No special messages appear when tiles are placed normally
- Standard progress updates show percentage completion
Fallback Activation:
- "⚠️ Using fallback tile selection with reset usage tracker..."
- Indicates usage limits have been reached
- System resets usage tracker to allow tile reuse
- Maintains adjacency constraints for quality
Final Fallback:
- "⚠️ Using final fallback - best color match without adjacency constraints..."
- Rare message indicating all constraints prevented placement
- System ignores adjacency to guarantee tile placement
- Ensures no empty cells in final mosaic
Interpreting Fallback Messages:
- Few fallback messages (< 1% of tiles): Normal operation
- Many fallback messages (> 10% of tiles): Consider adjusting settings:
- Increase "Max usage per image" value
- Reduce "Adjacency penalty weight"
- Add more material images
- Frequent final fallback: Indicates constraint conflicts or insufficient materials
Troubleshooting with Fallback Logs:
- Enable verbose logging in Advanced Settings
- Monitor generation log for fallback messages
- Adjust settings based on fallback frequency
- Use fallback patterns to optimize material collection
Collect Debug Information
When reporting issues, include:
System information:
- Operating system and version
- Rust version (
rustc --version
) - Application version
- System specifications (RAM, CPU)
Error details:
- Exact error messages
- Steps to reproduce
- Debug logs (with verbose logging enabled)
- Screenshots of error dialogs
Configuration:
- Settings used when error occurred
- File paths and directory structure
- Material image details (count, formats, sizes)
Performance Profiling
For performance issues:
# Monitor resource usage
top -p $(pgrep mosaic-gui)
# Check memory usage
ps aux | grep mosaic-gui
# Monitor file system usage
iostat -x 1
Platform-Specific Issues
Windows-Specific Issues
Issue: Console window appears alongside GUI Solution: Ensure using the correct GUI binary, not CLI binary
Issue: File dialogs look non-native Solution: Update Windows to latest version
Issue: Antivirus blocks execution Solution: Add exception for mosaic-gui executable
macOS-Specific Issues
Issue: "App is damaged and can't be opened" Solution:
# Remove quarantine attribute
xattr -d com.apple.quarantine mosaic-gui
Issue: File dialogs don't appear Solution: Grant file system access permissions in System Preferences
Linux-Specific Issues
Issue: GTK errors on startup Solution:
# Install GTK development packages
sudo apt-get install libgtk-3-dev
# For Wayland users
export GDK_BACKEND=wayland
Issue: Font rendering issues Solution:
# Install font packages
sudo apt-get install fonts-dejavu-core fonts-freefont-ttf
Getting Help
Self-Help Resources
- Enable verbose logging: Always start with detailed logs
- Check system requirements: Verify your platform is supported
- Try simpler settings: Reduce complexity to isolate issues
- Search documentation: Check other sections for related information
Community Support
- GitHub Issues: Report bugs and request features
- Documentation: Comprehensive guides and examples
- Discord/Forums: Community discussion and support
- Wiki: User-contributed tips and solutions
Reporting Bugs
When reporting issues:
- Use GitHub Issues: Primary bug tracking location
- Include details: System info, error messages, steps to reproduce
- Provide logs: Debug logs with verbose logging enabled
- Add screenshots: Visual evidence of issues
- Be specific: Exact settings and conditions that cause issues
Feature Requests
For new features:
- Check existing issues: Avoid duplicates
- Describe use case: Explain why the feature is needed
- Provide examples: Show how the feature would be used
- Consider alternatives: Suggest implementation approaches
Prevention Tips
System Maintenance
- Keep software updated: Update OS and Rust toolchain regularly
- Monitor resources: Keep adequate free disk space and RAM
- Regular backups: Backup important material collections
- Clean builds: Occasionally clean and rebuild the application
Best Practices
- Start simple: Begin with basic settings and gradually increase complexity
- Test incrementally: Make small changes and test results
- Document successful settings: Keep notes of working configurations
- Prepare materials: Organize and verify material images before use
Performance Optimization
- Use release builds: Always use optimized builds for production
- Optimize materials: Use consistent, high-quality material images
- Monitor resources: Keep system resources available during generation
- Batch processing: Process multiple mosaics with similar settings
By following this troubleshooting guide, you should be able to resolve most common issues with the GUI application. When in doubt, enable verbose logging and start with simpler settings to isolate problems.