BUG: Replacing an image at the same path retains stale AI metadata
メンテナーはふだん 4 日以内に返信
@risingsamurai がすでに取り組んでいます。
2026年11月20日 から。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 45/100
調査の方向性
Start from the folder-synchronization code that detects a changed file and prepares the updated image record, then follow it into the database upsert keyed on the image path. Check which fields the upsert preserves — particularly isTagged, isEmbedded, GPS and the related tag/face/embedding records — and decide what must be reset or deleted when content changes. Reproduce by adding an image, letting AI processing finish, replacing the file at the same path, and re-running sync; done means fresh processing is scheduled and a regression test covers the same-path replacement.
索引モデルが issue の本文から書いたものです。
説明
Is there an existing issue for this?
- I have searched the existing issues
What happened?
When an existing image is replaced with different image content at the same filesystem path, PictoPy may retain the previous image's AI-generated metadata and processing state.
The synchronization logic detects the changed file and prepares an updated image record. However, when the database performs an upsert using the existing image path, the existing record's ID and AI-processing flags may be retained instead of being reset for the new content.
Consequently, the replacement image may continue using the previous image's tags, embeddings, face information, or semantic metadata, and may not be scheduled for fresh AI processing.
Steps to Reproduce
- Add an image to PictoPy.
- Allow AI tagging and embedding generation to finish.
- Record the image's existing AI tags and processing state.
- Replace the image file with completely different content while keeping the same filename and filesystem path.
- Trigger folder synchronization.
- Inspect the updated image record and its associated AI data.
- Verify whether the replacement image receives fresh AI processing.
Expected Behavior
When PictoPy detects that image content has changed:
- The previous content's AI-generated metadata should not be associated with the replacement image.
- Relevant AI-processing flags should be reset.
- Old tags, face records, and embeddings associated with the previous content should be invalidated or replaced.
- The replacement image should be scheduled for fresh AI processing.
- Metadata such as GPS coordinates should reflect the replacement file rather than retain stale values.
Actual Behavior
The database upsert appears to preserve the existing image identity and AI-processing flags when a record with the same path already exists.
In particular, existing isTagged and isEmbedded values may remain true even when the image content has changed.
This can prevent the replacement image from entering normal AI-processing pipelines, while existing AI-generated metadata and related records remain associated with the image's database identity.
As a result, the gallery, tagging, face-related data, or semantic search may continue reflecting the original image instead of the replacement content.
Impact
- Incorrect AI tags may remain attached to replaced images.
- Face-related metadata may describe the previous image.
- Image embeddings may represent outdated content.
- Semantic search may return results based on the previous image.
- Replacement images may be skipped by AI-processing queues if their flags indicate that processing has already completed.
Suggested Fix
When a same-path image replacement is detected:
- Update or invalidate content-dependent AI metadata.
- Reset AI-processing flags so the replacement is processed again.
- Remove or regenerate stale embeddings, face records, and semantic metadata.
- Ensure GPS and other file-derived metadata are updated correctly, including clearing values that are no longer present.
- Add regression tests for replacing an already-processed image with different content at the same path.
Record
- I agree to follow this project's Code of Conduct
- 主要言語
- Python
- スター
- 322
- フォーク
- 793
- 平均マージ
- 6日 9時間
- マージ済み PR(30日)
- 20
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
AOSSIE-Org/PictoPy のほかの issue
-
BUG: Semantic search sees portrait phone photos sideways (SigLIP ignores EXIF orientation)対応中かも @jayssSmm が 1 日前に担当しました。 オープンbug enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
AOSSIE-Org/PictoPy#1780 · コメント 5 件 ·
メンテナーはふだん 4 日以内に返信
-
BUG: Share password loses leading/trailing spaces so the password you set doesn't work対応中かも @swastiksharma45 が 2 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
AOSSIE-Org/PictoPy#1779 · コメント 2 件 ·
メンテナーはふだん 4 日以内に返信
-
BUG: PROD: Face search shows "No Matches Found" for every empty result, even when AI tagging is off対応中かも @dhruvbit が 3 日前に担当しました。 オープンbug enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
AOSSIE-Org/PictoPy#1770 · コメント 3 件 ·
メンテナーはふだん 4 日以内に返信
-
BUG: Add images to album: success message shows requested count, not number actually added対応中かも @riyanshbhosale が 5 日前に担当しました。 オープンbug enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
AOSSIE-Org/PictoPy#1740 · コメント 4 件 ·
メンテナーはふだん 4 日以内に返信
-
BUG: /sync-folder does not validate the supplied folder_id再び着手できるかも @sathvikn113 が 10 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンbug possible-duplicate
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
AOSSIE-Org/PictoPy#1731 · コメント 5 件 ·
メンテナーはふだん 4 日以内に返信
AOSSIE-Org/PictoPy の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
-
bug help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
cofade/open-garden-planner#1044 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
codecrafters-io/build-your-own-x#2126 ·
メンテナーはふだん 5 日以内に返信
-
documentation good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
julianleno/cortai#10 ·
-
difficulty:easy func:python os:windows prio:high type:bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
NatronGitHub/Natron#2029 ·
メンテナーはふだん 1 日以内に返信