RupertAvery / DiffusionToolkit

Metadata-indexer and Viewer for AI-generated images
MIT License
709 stars 44 forks source link

[BUG] Moving an image doesn't move the associated .txt metadata. #239

Open dterhorst opened 2 months ago

dterhorst commented 2 months ago

Describe the bug If you right-click on an image that has .txt metadata and choose the Move option, the .txt metadata is not moved with the image.

Version: v1.6.1

To Reproduce

  1. Create a new folder named example.
  2. Add example/example.jpg and example/example.txt. The content shouldn't matter.
  3. Create an example/destination folder.
  4. If you have any existing copies of Diffusion Toolkit, make sure they are in "Portable Mode".
  5. Run a fresh copy of Diffusion Toolkit.
  6. Click the X button to dismiss the Welcome splash.
  7. In Settings, under Diffusion Folders, add the example folder.
  8. Choose "Portable Mode".
  9. Press Apply.
  10. Press "Yes" to scan folders now.
  11. Press the Scan icon on the left to actually do it for real because it doesn't work the first time. 💢
  12. Open Settings and click "Portable Mode" (and "Apply") again to actually do it for real because it doesn't work the first time. 💢
  13. In the main grid, right-click the image and select "Move" from the context menu.
  14. Choose example/destination and press "Select Folder"

Expected behavior

Actual behavior

Screenshots 20240416010444 20240416011724 20240416010503

Additional context Diffusion Toolkit strongly encourages you to manage files from within the app. If you manage files manually from outside the app, the database gets out-of-date and the images appear "Unavailable" inside the app. Messing with .txt metadata can force you to execute a costly "Rebuild metadata."

That, in combination with this bug, leads to a worst-of-both-worlds scenario where you have to manage some files from within the app, but then manually track down their original location anyway to move the metadata by hand. (Assuming you even notice the problem occurred.)

I am using Diffusion Toolkit to manage over 100k images, spread across countless directories. If I moved a batch of a hundred images at a time, it would be daunting to even think about guessing where they all came from so I could fix orphaned metadata one-by-one.

RupertAvery commented 2 months ago

This build artifact should have these changes, if you don't want to wait for an official build:

https://github.com/RupertAvery/DiffusionToolkit/actions/runs/8773444541/artifacts/1433316835

Latest builds will appear in https://github.com/RupertAvery/DiffusionToolkit/actions. Click on the workflow run and scroll down to the artifacts and download DiffusionToolkit.