mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-20 06:44:32 +00:00
## Summary Fix drag-and-drop of local screenshots onto the canvas failing to create a LoadImage node. ## Changes - **What**: Replace `_.isEmpty(workflowData)` check in `handleFile` with a check for workflow-relevant keys (`workflow`, `prompt`, `parameters`, `templates`). PNG screenshots often contain non-workflow `tEXt` metadata (e.g. `Software`, `Creation Time`) which made `_.isEmpty()` return `false`, skipping the LoadImage fallback and showing an error instead. ## Review Focus The root cause is that `getPngMetadata` extracts all `tEXt`/`iTXt` PNG chunks indiscriminately. Rather than filtering at the parser level (which could break extensions relying on arbitrary metadata), the fix checks for workflow-relevant keys before deciding whether to treat the file as a workflow or a plain image. Fixes #7752 ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8886-fix-drag-and-drop-screenshot-creates-LoadImage-node-instead-of-showing-error-3086d73d3650817d86c5f1386aa041c2) by [Unito](https://www.unito.io) --------- Co-authored-by: github-actions <github-actions@github.com>