pyPhotoAlbum
A Python (PyQt6) application for designing photo albums and exporting them to PDF.
Features
Core Features
- Basic application structure with OpenGL rendering
- Menu system (File, Edit, View)
- Toolbar and status bar
- Page layout controls (custom sizes, DPI settings, page management)
- Template pages with grid layouts
- Image drag-and-drop from file explorer
- Image auto-scaling and center-crop fitting
- Image rendering with OpenGL textures
- Object selection, moving, and resizing
- Mouse wheel zoom (10%-500%)
- Interactive cropping with constrained movement
- Text box support with rotation
- Undo/redo functionality
- PDF export
- XML project save/load
Additional Features
- Grid cell merging for spanning photos
- Double-page spread flag (rendering not yet implemented)
- Default minimum distance between images
- Page numbering system
- Add/Remove pages dynamically
- Background color/pattern options
- Theme presets
Technical Stack
- Python 3.9+
- PyQt6 for GUI
- OpenGL for rendering
- ReportLab for PDF generation
- lxml for XML serialization
- Pillow for image processing
Installation
For Users
Install the package using pip:
pip install .
Or for an editable installation (development):
pip install -e .
After installation, you can run the application with:
pyphotoalbum
For Developers
-
Clone the repository:
git clone <your-repo-url> cd pyPhotoAlbum -
Create virtual environment:
python -m venv venv -
Activate virtual environment:
- Windows:
venv\Scripts\activate - Linux/macOS:
source venv/bin/activate
- Windows:
-
Install in development mode with dev dependencies:
pip install -e ".[dev]"
Running the Application
After installation, run:
pyphotoalbum
Or, for development, you can still run directly:
python pyPhotoAlbum/main.py
Testing
Running Tests
Run all tests with coverage:
pytest
Run tests with verbose output:
pytest -v
Run specific test file:
pytest tests/test_models.py
Run tests with coverage report:
pytest --cov=pyPhotoAlbum --cov-report=html
Then open htmlcov/index.html in your browser to view the coverage report.
Continuous Integration
The project uses Gitea Actions for CI/CD:
- Tests: Runs on Python 3.9, 3.10, and 3.11 on every push
- Linting: Checks code quality with flake8, black, and mypy
View workflow status in your Gitea repository's Actions tab.
Project Structure
pyPhotoAlbum/
├── main.py # Main application entry point
├── requirements.txt # Python dependencies
└── README.md # Project documentation
Development Roadmap
-
Phase 1: Core Functionality
- Complete page layout controls
- Implement template system
- Add image handling capabilities
- Implement text box support
-
Phase 2: Advanced Features
- Add undo/redo functionality
- Implement PDF export
- Add XML project serialization
-
Phase 3: Polish and Optimization
- Optimize rendering performance
- Add additional UI polish
- Implement comprehensive testing