画像読み込み時のファイルハンドル保持問題を修正#205
Merged
Merged
Conversation
Agent-Logs-Url: https://github.com/Freeesia/VdLabel/sessions/769b5045-24de-42dc-a378-28274fad0e77 Co-authored-by: Freeesia <9002657+Freeesia@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix issue with holding file handle when setting image
画像読み込み時のファイルハンドル保持問題を修正
May 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WPF がファイルパス文字列を
ImageSourceに型変換する際、デフォルト動作ではファイルハンドルを保持し続けるため、設定済み画像の削除・移動・上書きができなかった。変更内容
FilePathToImageSourceConverterを追加 (OverlayWindow.xaml.cs)BitmapCacheOption.OnLoadで読み込み後即座にファイルハンドルを解放。Freeze()でスレッドセーフ化。壊れたファイルや非対応形式はnullを返して安全に処理。XAML バインディングを更新(4箇所)
OverlayWindow.xaml・MainWindow.xaml(2箇所)・DesktopCatalog.xamlのSource="{Binding ImagePath}"をすべてコンバーター経由に変更。