fix history search missing metadata for .webp images#1420
Open
jakstein wants to merge 1 commit into
Open
Conversation
03c9f8a to
4d46cbb
Compare
4d46cbb to
1f40c4a
Compare
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.
So basically history panel's text search was missing images whose filenames don't contain the search term (e.g. searching by prompt content). The searchable string on each file is built from name, metadata, fullsrc, but .webp files always had null metadata because ImageSharp's WebP decoder doesn't populate ExifProfile.
The metadata IS embedded in webp files (as EXIF UserComment, written at ImageFile.cs:306), but GetMetadata() only checked img.Metadata.ExifProfile which is null for WebP in ImageSharp 3.1.12.
Changes:
OutputMetadataTracker.cs:123 - Add "webp" to ExtensionsWithMetadata
OutputMetadataTracker.cs:338 - Invalidate cached entries with null Metadata for extractable formats, so stale null-metadata entries (cached before webp was in the set) get force-re-readImageFile.cs:224 - Fallback to ReadExifUserCommentFromRaw() when ImageSharp's ExifProfile returns nullImageFile.cs:238-370 - New ReadExifUserCommentFromRaw() method that parses the EXIF UserComment tag (0x9286) directly from raw binary bytes, matching what the client-side ExifReader JS library does successfully