Skip to content

Add direct image input support - #104

Draft
amirgholipour wants to merge 1 commit into
aws-samples:mainfrom
amirgholipour:agent/image-input-support
Draft

Add direct image input support#104
amirgholipour wants to merge 1 commit into
aws-samples:mainfrom
amirgholipour:agent/image-input-support

Conversation

@amirgholipour

Copy link
Copy Markdown

What changed

  • Accept PNG, JPEG/JPG, TIFF/TIF, and PDF uploads in the current React and Express UI.
  • Validate file signatures as well as extensions before uploading to S3.
  • Preserve the detected content type and distinguish direct images from PDFs.
  • Send direct images to classification as one-page inputs without PDF conversion.
  • Update the agent workflow and UI documentation for the supported formats.

Why this change is proposed

The upload path currently assumes every input is a PDF. Image-only documents therefore require an external conversion step even though the downstream specialists already operate on images. Relying on the browser-provided MIME type alone would also allow an extension/content mismatch.

This change makes the upload boundary understand the formats the processing pipeline can already consume. Signature checks keep validation server-side, and direct images skip an unnecessary conversion stage.

Benefits

  • Supports common scanning and archival formats directly.
  • Reduces preprocessing and latency for single-page images.
  • Avoids quality loss caused by wrapping an image in a PDF before analysis.
  • Preserves the existing PDF path and current UI architecture.

Validation

  • Tested PNG upload and direct-image processing against a deployed BADGERS environment.
  • Verified PDF behavior remains available.
  • Verified production UI build with pnpm.
  • Reviewed the branch against the current upstream main.

Authored by Saeed Kasmani (amirgholipour).

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.

1 participant