Skip to content

fix history search missing metadata for .webp images#1420

Open
jakstein wants to merge 1 commit into
mcmonkeyprojects:masterfrom
jakstein:fix/webp-history-metadata
Open

fix history search missing metadata for .webp images#1420
jakstein wants to merge 1 commit into
mcmonkeyprojects:masterfrom
jakstein:fix/webp-history-metadata

Conversation

@jakstein

@jakstein jakstein commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

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-read
ImageFile.cs:224 - Fallback to ReadExifUserCommentFromRaw() when ImageSharp's ExifProfile returns null
ImageFile.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

Comment thread src/Utils/OutputMetadataTracker.cs Outdated
Comment thread src/Media/ImageFile.cs Outdated
@jakstein jakstein force-pushed the fix/webp-history-metadata branch from 03c9f8a to 4d46cbb Compare June 19, 2026 09:59
@jakstein jakstein force-pushed the fix/webp-history-metadata branch from 4d46cbb to 1f40c4a Compare June 19, 2026 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants