Expert guide for developing ComicView, a cross-platform Python/PyQt5 image archive viewer for comics and photo collections
Expert assistant for developing and maintaining ComicView, a Python-based image archive viewer for ZIP, RAR, CBR, and CBZ files. Built with PyQt5 for cross-platform comic book reading and photo collection viewing.
ComicView is a fullscreen slideshow application for browsing image archives with:
```
src/image_archive_viewer/
├── viewer.py # Main UI and application logic
├── archive_reader.py # Archive reading and image processing
├── logging_setup.py # Logging configuration
└── __init__.py # Package initialization
tests/
├── fixtures/ # Test archives and creation scripts
├── test_*.py # Unit test modules
└── conftest.py # Shared test fixtures
pyproject.toml # Project configuration and dependencies
uv.lock # Dependency lock file
```
1. **Install in development mode:**
```bash
uv pip install -e .
```
2. **Install from PyPI:**
```bash
# As a uv tool
uv tool install image-archive-viewer
# Or via pip
pip install image-archive-viewer
```
3. **RAR support requirement:**
- **macOS/Linux**: Install `unrar` via package manager (e.g., Homebrew)
- **Windows**: Download from [RARLab](https://www.rarlab.com/rar_add.htm) and add to PATH
```bash
comic_view
comic_view -v
```
```bash
pytest
pytest -v
pytest tests/test_archive_reader.py
cd tests/fixtures && python create_test_fixtures.py
```
**Test modules:**
```bash
python -m build
uv build
```
1. Archive opened with appropriate library based on extension
2. Images converted: PIL Image → QImage (RGB888) → QPixmap
3. All images cached in memory as QPixmap objects
4. Archive contents sorted alphabetically
1. First image loaded immediately in `load_images()`
2. Remaining images loaded via `QTimer.singleShot(0, self.load_remaining_images)`
3. Startup overlay updated when loading completes
4. Graceful error handling for `rarfile.BadRarFile`
```python
PyQt5 # Complete GUI framework
Pillow # Image processing (PIL.Image)
rarfile # RAR/CBR archive support
```
1. **Read existing code first** - Understand current implementations before modifying
2. **Run tests** - Ensure `pytest` passes after changes
3. **Test all formats** - Verify ZIP, CBZ, RAR, and CBR support
4. **Check cross-platform** - Consider Linux, macOS, and Windows compatibility
5. **Update logging** - Add appropriate debug/info messages for new features
6. **Maintain zoom/pan** - Preserve cursor-centered zoom behavior
7. **Keep overlays functional** - Ensure help and startup overlays work correctly
1. Update `archive_reader.py` with new format detection
2. Add appropriate library dependency to `pyproject.toml`
3. Create test fixtures in `tests/fixtures/`
4. Add test cases to `test_archive_reader.py`
1. Update event handlers in `viewer.py`
2. Update help overlay text with new key bindings
3. Test keyboard, mouse, and wheel interactions
4. Ensure zoom/pan behavior remains consistent
1. Review image caching strategy in `load_remaining_images()`
2. Consider QPixmap conversion efficiency
3. Profile memory usage with large archives
4. Test progressive loading timing
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/comicview-image-archive-viewer-development-assistant/raw