Skip to content

Process With --skipbackup Deletes a Different File When an Extension Rename Collides #280

Closed

Description

@ptr727

Problem

process --skipbackup deletes a file it was never asked to touch when an extension rename lands on a name that already exists.

A file whose extension disagrees with its content is renamed to the extension exiftool expects. When the folder already holds a different file under the target name, ProcessTask.MoveFile deletes that file and logs Deleting conflicting file (no backup), then renames over it. Without --skipbackup the same path moves the existing file to a .bak name, so only the no-backup mode loses data.

How to reproduce

Constructed case, in one folder:

  • photo.dng, whose content is a JPEG.
  • photo.jpg, a different JPEG.

Run process --path <folder> --db <db> --skipbackup. The log shows:

File extension '.dng' does not match exiftool expected '.jpg': 'photo.dng'
Deleting conflicting file (no backup): 'photo.jpg'
Renaming 'photo.dng' to 'photo.jpg'

One file remains where two went in. The log also printed Deferring 1 extension conflict(s) for the same stem before the deletion, so the deferral did not prevent it.

Where it was seen

A one-off import of a cloud photo export, where the export had re-encoded a raw file to JPEG and kept the raw extension beside the camera's own JPEG of the same name. One file of about 6,000 was lost from the processed copy. The source was untouched, so it was recovered by importing that file again, and import named it photo_1.jpg.

Expected

process never deletes a file because another file needs its name. The renamed file takes a free name, as import already does with its _1 suffix, and the run reports the collision.

Activity

  1. added
    bug
    on Nov 18, 2026
  2. ptr727 commented on Nov 18, 2026

    @ptr727
    OwnerAuthor

    Released (2026-11-18): #286 merged to develop at d3906ab, and its branch and worktree are cleaned up. The issue closes when the promotion to main lands.

    Backlog burndown claim (2026-11-18, round 1): group #280 + #281 on branch fix/process-collision-and-odd-gif.

    Predicted files:

    • PhotoCleaner/ProcessTask.cs
    • PhotoCleanerTests/ProcessTaskTests.cs
    • GUIDE.md
    • ARCHITECTURE.md
    • README.md (granted 2026-11-18: the Undo Flow known limitation and the --skipbackup note describe the behaviour this change alters)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions