Skip to content

fix: honor empty-string metadata overrides#9283

Open
wunianze666-netizen wants to merge 1 commit into
invoke-ai:mainfrom
wunianze666-netizen:fix/metadata-override-empty-string
Open

fix: honor empty-string metadata overrides#9283
wunianze666-netizen wants to merge 1 commit into
invoke-ai:mainfrom
wunianze666-netizen:fix/metadata-override-empty-string

Conversation

@wunianze666-netizen

Copy link
Copy Markdown

Summary

This PR makes metadata overrides in extract_metadata_from_image() honor explicitly provided empty strings instead of falling back to embedded image metadata.

Problem

The helper currently uses override or pil_image.info.get(...) for metadata, workflow, and graph overrides. That means an explicit empty-string override is treated as falsy and ignored, so the function silently falls back to the image's embedded metadata.

Changes

  • use is not None checks for metadata/workflow/graph overrides
  • add a test to ensure empty-string overrides do not fall back to image metadata

Verification

  • python -m py_compile invokeai/app/api/extract_metadata_from_image.py tests/app/test_extract_metadata_from_image.py
  • Not run: pytest is not available in this environment, so I could not execute the new test locally.

@github-actions github-actions Bot added api python PRs that change python files python-tests PRs that change python tests labels Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api python PRs that change python files python-tests PRs that change python tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant