Feature Request: Conditional title templates with label-based logic
User Story
As a user, I'd like to be able to define title templates with conditional logic based on labels.
What problem does this solve, and why would it be valuable to many users?
Users with large libraries (50k–200k+ photos) face three critical issues:
No Automation
- Every photo requires manual title entry to achieve consistency
- No way to generate titles from existing metadata (Artist, City, Year, Labels)
- Templates would reduce 100+ hours of work to minutes
Inconsistent Titles
- Photos from the same event have mismatched or duplicate titles
- Search by title becomes unreliable
- Professional users cannot enforce naming policies
External Workarounds Required
- Users must resort to ExifTool scripts outside PhotoPrism
- Breaks the integrated workflow
- Sync issues between external edits and PhotoPrism database
Real-World Example
A user with 150k photos wants titles like:
"Family Name - Location - Event - Year"
Without templating:
- 150,000 manual edits required
- Or accept inconsistent/generic titles
- Or maintain separate ExifTool scripts (fragile, error-prone)
Why This Is Valuable
For Power Users (Primary Audience)
| Benefit | Impact |
|---|---|
| Time savings | 100+ hours → minutes for 100k photo library |
| Consistency | Uniform titles across entire collection |
| Searchability | Better results with predictable title patterns |
| Workflow integrity | Keep all work inside PhotoPrism UI |
For Casual Users
| Benefit | Impact |
|---|---|
| Smart defaults | Auto-generated titles without manual entry |
| Flexibility | Override auto-titles when needed |
| Future-proofing | XMP sync ensures portability to other tools |
For the Project
| Benefit | Impact |
|---|---|
| Competitive parity | Matches Lightroom/DigiKam capabilities |
| Reduced support burden | Fewer requests for external scripting help |
| Enterprise appeal | Makes PhotoPrism viable for professional workflows |
Quantified Value
| Metric | Before Templating | After Templating |
|---|---|---|
| Time to title 10k photos | 40–80 hours | < 1 hour |
| Title consistency | ~60% manual coverage | ~100% automated |
| Workflow complexity | Requires external tools | All-in-one solution |
| User satisfaction | Moderate (workaround fatigue) | High (native solution) |
Who Would Benefit?
- Photographers (10k–200k photos): Client work, portfolio organization
- Families (50k+ photos): Generational archives with consistent naming
- Librarians/Archivists: Institutional collections requiring metadata standards
- Self-hosted enthusiasts: Users who value native solutions over scripting
Bottom Line
This feature transforms PhotoPrism from "good enough" to "production-ready" for users managing large collections professionally. Without it, serious users are forced into external workarounds that undermine the integrated experience PhotoPrism promises.
What solution do you propose?
Implementation of a title templating engine that allows users to define custom title formats using variable placeholders and conditional logic based on labels/metadata.
Variable Placeholders
- {Artist}, {Person}, {City}, {Country}, {Location}
- {Year}, {Month}, {Day}
- {CameraMake}, {LensModel}, {Label}, etc.
Conditional Logic
- Syntax:
{if:label:X then 'Y' else ''} - Example:
{if:label:Bogus then 'Bogus'} - Nesting support for multiple conditions
- Syntax:
Bulk Application
- Apply templates to selected photos via UI
- Preview generated titles before committing
- Undo capability for bulk operations
Persistence & Sync
- Sync to XMP/YAML sidecar files
- Preserve manually overridden titles
- Respect PHOTOPRISM_SIDECAR settings
Which alternatives or workarounds have you considered?
Evaluated Alternatives
1. External ExifTool Scripts
Description: Write Bash/Python scripts using ExifTool to batch-generate titles from metadata.
| Pros | Cons |
|---|---|
| ✅ Full control over template logic | ❌ Breaks PhotoPrism workflow |
| ✅ Powerful conditional expressions | ❌ Sync issues with PhotoPrism database |
| ✅ No PhotoPrism dependencies needed | ❌ Requires command-line knowledge |
| ❌ Risk of database inconsistency if sync fails |
Verdict: Viable but fragile. Users must maintain two parallel systems.
2. PhotoPrism Labels Workaround
Description: Use Labels instead of Titles for organization (e.g., "Vacances_2026_Bretagne" as label).
| Pros | Cons |
|---|---|
| ✅ Native UI support for labels | ❌ Labels ≠ Titles (different semantics) |
✅ Searchable via label:X syntax |
❌ Less human-readable than titles |
| ✅ Bulk edit available | ❌ Cannot combine metadata fields |
| ❌ Poor for display purposes (albums, sharing) |
Verdict: Insufficient. Labels serve categorization, not descriptive naming.
3. Lightroom Classic Integration
Description: Use Lightroom's built-in file renaming templates for PhotoPrism imports.
| Pros | Cons |
|---|---|
| ✅ Mature templating system | ❌ Requires subscription (€10+/month) |
| ✅ Cloud-synced metadata | ❌ Not privacy-focused (cloud option) |
| ✅ Industry standard for photographers | ❌ Vendor lock-in risk |
Verdict: Unacceptable for self-hosted users who chose PhotoPrism for privacy.
4. Manual Title Entry
Description: Edit each photo's title individually via PhotoPrism UI.
| Pros | Cons |
|---|---|
| ✅ Perfect precision | ❌ 100+ hours for 100k photos |
| ✅ Full control | ❌ Not scalable beyond 1k photos |
| ✅ No setup required | ❌ Leads to inconsistent coverage (~60% max) |
Verdict: Only feasible for small libraries (<5k photos).
5. DigiKam + XMP Sync
Description: Manage metadata in DigiKam, then import to PhotoPrism via XMP.
| Pros | Cons |
|---|---|
| ✅ Free, open-source | ❌ Desktop-only (no web UI) |
| ✅ Advanced batch metadata editing | ❌ Two-system complexity |
| ✅ XMP-compatible | ❌ Sync reliability varies |
Verdict: Possible but defeats purpose of single-platform management.
6. Custom API Solutions
Description: Use PhotoPrism REST API to script title generation programmatically.
| Pros | Cons |
|---|---|
| ✅ Flexible | ❌ Requires programming skills |
| ✅ Integrates with PhotoPrism DB | ❌ Maintenance overhead increases |
| ❌ Not user-friendly for non-developers |
Verdict: Accessible only to technical users.
Why None of These Are Adequate
| Criterion | ExifTool | Labels | Lightroom | Manual | DigiKam | API | Proposed Template |
|---|---|---|---|---|---|---|---|
| Native to PhotoPrism | ❌ | ✅ | ❌ | ✅ | ❌ | ⚠️ | ✅ |
| Conditional logic | ✅ | ❌ | ✅ | N/A | ⚠️ | ⚠️ | ✅ |
| Scalable (100k+ photos) | ✅ | ⚠️ | ✅ | ❌ | ✅ | ⚠️ | ✅ |
| No extra cost | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ |
| Privacy-preserving | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ |
| User-friendly UI | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ |
Only the proposed template feature satisfies all criteria simultaneously.
Have you verified that no similar issues exist?
- This is not a support request, and I verified that no similar issues exist
Additional Context
Reference Implementation
Similar functionality exists in:
- Adobe Lightroom Classic: File Renaming feature
- DigiKam: Rename/Move Photos batch tool
- ExifTool: Filename formatting options
Expected Token Support
At minimum, support these standard metadata fields:
- {Artist}, {Person}, {City}, {Country}, {Location}
- {Year}, {Month}, {Day}
- {CameraMake}, {CameraModel}, {LensModel}
- {ISO}, {FocalLength}, {ExposureTime}
Performance Expectations
- Background processing for large libraries
Backward Compatibility
- Existing manually-edited titles must NOT be overwritten
- Old titles without templates remain unchanged
- Migration script optional (not required on install)
Security Considerations
- No arbitrary code execution (pure string interpolation only)
- Sanitization of user-generated content for display
Acceptance Criteria
- The title editor MUST support variable placeholders: {Artist}, {City}, {Year}, etc.
- The template engine MUST support conditional logic: "{if:label:X then 'Y'}"
- The system SHOULD preserve manually overridden titles
- Generated titles MUST sync to XMP sidecar files
- The system MUST NOT overwrite manually edited titles
- Template syntax SHOULD be consistent across UI and API
- Null/empty fields MUST be gracefully skipped (no "undefined" in output)
Source: photoprism/photoprism