n8n - 💡(How to fix) Fix Edit Image composite fails with "Stream yields empty buffer" on valid Gemini-generated PNG in n8n 2.19.5 [3 comments, 4 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
n8n-io/n8n#30170Fetched 2026-05-11 03:26:54
View on GitHub
Comments
3
Participants
4
Timeline
7
Reactions
1
Timeline (top)
commented ×3subscribed ×2labeled ×1mentioned ×1

Error Message

Describe the problem/error/question

I also tried stripping PNG metadata chunks such as iCCP, sRGB, gAMA, cHRM, tEXt, iTXt, and zTXt before the composite step. The PNG remained valid, but the composite node still failed with the same error.

  • return a more specific image decoding/composite error explaining which input binary property or format is unsupported. The node fails with a generic Stream yields empty buffer error.

What is the error message (if any)?

"Error: Stream yields empty buffer",

RAW_BUFFERClick to expand / collapse

Describe the problem/error/question

The Edit Image node fails during composite operation with:

Stream yields empty buffer

The input image appears to be a valid PNG generated by Gemini image generation API. The binary file exists and can be viewed/downloaded in n8n UI.

This happens when compositing a logo image onto the generated PNG.

Workflow sequence:

  1. Gemini API returns inline base64 image data
  2. Convert to File converts it to binary property data
  3. Google Drive node downloads a logo into binary property logo
  4. Edit Image1 resizes the logo successfully
  5. Edit Image composite fails when compositing logo onto data

The failure seems to come from the underlying [email protected] dependency used by n8n's Edit Image node.

I also tried stripping PNG metadata chunks such as iCCP, sRGB, gAMA, cHRM, tEXt, iTXt, and zTXt before the composite step. The PNG remained valid, but the composite node still failed with the same error.

Expected behavior:

The Edit Image node should either:

  • successfully composite a valid PNG image, or
  • return a more specific image decoding/composite error explaining which input binary property or format is unsupported.

Actual behavior:

The node fails with a generic Stream yields empty buffer error.

What is the error message (if any)?

{
  "errorMessage": "Stream yields empty buffer",
  "errorDetails": {},
  "n8nDetails": {
    "n8nVersion": "2.19.5 (Self Hosted)",
    "binaryDataMode": "filesystem",
    "stackTrace": [
      "Error: Stream yields empty buffer",
      "    at Socket.<anonymous> (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/[email protected]/node_modules/gm/lib/command.js:56:21)",
      "    at Socket.emit (node:events:520:35)",
      "    at endReadableNT (node:internal/streams/readable:1729:12)",
      "    at processTicksAndRejections (node:internal/process/task_queues:90:21)"
    ]
  }
}

<img width="1068" height="1106" alt="Image" src="https://github.com/user-attachments/assets/0221a805-5fe1-4987-a8eb-f11b755012f9" />

<img width="1068" height="1096" alt="Image" src="https://github.com/user-attachments/assets/603586ca-f2a2-47e2-b255-04c66a81325d" />

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING