deepseek-ai/deepseek-harness · error · AttachmentError

IMAGE_TOO_LARGE

IMAGE_TOO_LARGE

Error message

Image cannot be encoded within the configured normalized-image byte cap.

What it means

Error "Image cannot be encoded within the configured normalized-image byte cap." thrown in deepseek-ai/deepseek-harness.

Source

Thrown at packages/attachment/attachment-local/src/normalization.ts:205

      const sizeScale = Math.sqrt(policy.maxBytes / encoded.smallest.data.byteLength) * 0.95
      const scale = Math.min(MIN_SCALE_STEP, sizeScale)
      const nextWidth = Math.max(1, Math.floor(width * scale))
      const nextHeight = Math.max(1, Math.floor(height * scale))
      width = nextWidth
      height = nextHeight
    }
  } catch (error) {
    if (error instanceof AttachmentError) throw error
    const source = detected.mediaType === 'image/png' && detected.depth !== 'uchar'
      ? `${detected.depth === 'ushort' ? '16-bit' : detected.depth} PNG`
      : `${detected.depth} ${detected.mediaType.slice('image/'.length).toUpperCase()}`
    throw new AttachmentError(
      `The ${source} could not be converted to the normalized 8-bit sRGB form.`,
      'ATTACHMENT_WRITE_FAILED',
      { cause: error },
    )
  }
  throw new AttachmentError('Image cannot be encoded within the configured normalized-image byte cap.', 'IMAGE_TOO_LARGE')
}

View on GitHub (pinned to b150a551b8)

Solutions

  1. Reduce the image resolution or quality, or raise the configured normalized-image byte cap.

When it happens

Trigger: Thrown at packages/attachment/attachment-local/src/normalization.ts:205 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of deepseek-ai/deepseek-harness@b150a551b8 (2026-08-24). Data as JSON: /api/errors/22d732d3c6560c6a. Report an issue: GitHub.