Skip to content

fix(server): allow clearing asset description to blank#26900

Closed
saurav61091 wants to merge 1 commit intoimmich-app:mainfrom
saurav61091:fix/blank-description-exif
Closed

fix(server): allow clearing asset description to blank#26900
saurav61091 wants to merge 1 commit intoimmich-app:mainfrom
saurav61091:fix/blank-description-exif

Conversation

@saurav61091
Copy link

@saurav61091 saurav61091 commented Mar 13, 2026

Description

When a user clears an asset's description to blank, the description reverts to the EXIF-embedded value on the next metadata extraction.

Root cause: exiftool treats empty strings as "delete field", removing tags from the sidecar. Then unlockProperties removes the lock on description, allowing the next metadata extraction to overwrite the empty DB value with the original EXIF-embedded description.

Fix:

  • Skip writing empty description to sidecar (exiftool would just delete it anyway)
  • Keep description in lockedProperties when explicitly cleared, so subsequent metadata extractions preserve the user's intent

Fixes #19168

How Has This Been Tested?

  • Set a description on an asset, then clear it to blank — verify it stays empty after refresh
  • Set a non-empty description — verify it still works correctly
  • Run metadata extraction — verify blank description is preserved
  • Bulk update descriptions — verify it works correctly

Screenshots (if appropriate)

N/A — server-side logic fix, no UI changes.

Checklist:

  • I have carefully read CONTRIBUTING.md
  • I have performed a self-review of my own code
  • I have no unrelated changes in the PR
  • I have confirmed that any new dependencies are strictly necessary
  • I have followed naming conventions/patterns in the surrounding code
  • All code in src/services/ uses repositories implementations for database calls, filesystem operations, etc.

Please describe to which degree, if any, an LLM was used in creating this pull request.

An LLM (Claude) was used to assist with understanding the metadata extraction pipeline, identifying the root cause across the sidecar write and unlock flow, and drafting the fix. I reviewed the changes and confirmed the approach handles the edge cases correctly.

When a user clears a description, exiftool treats empty strings as
"delete field" and removes the tags from the sidecar. Then
unlockProperties removes the lock, allowing the next metadata
extraction to overwrite the empty DB value with the EXIF-embedded
description.

Fix: skip writing empty description to sidecar (since exiftool would
just delete it) and keep 'description' in lockedProperties so
subsequent extractions preserve the user's intent of an empty
description.

Fixes immich-app#19168
@immich-push-o-matic
Copy link

immich-push-o-matic bot commented Mar 13, 2026

Label error. Requires exactly 1 of: changelog:.*. Found: 🗄️server. A maintainer will add the required label.

@bo0tzz
Copy link
Member

bo0tzz commented Mar 13, 2026

Please fill out the complete PR template

@saurav61091
Copy link
Author

Hi @bo0tzz, I've updated the PR description with the complete template. Could you take another look? Thanks!

@bo0tzz
Copy link
Member

bo0tzz commented Mar 18, 2026

Superseded by #27025

@bo0tzz bo0tzz closed this Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can't set image description to blank

2 participants