Skip to content

Avoid unsupported PNG ScanJobs requests and validate eSCL formats (#8) - #9

Open
boingball wants to merge 5 commits into
mainfrom
fix/issue-8-png-capabilities
Open

boingball wants to merge 5 commits into
mainfrom
fix/issue-8-png-capabilities

Conversation

@boingball

@boingball boingball commented Sep 18, 2026

Copy link
Copy Markdown
Owner

Issue

Addresses #8. The Epson XP-345 still needs real-device verification before the issue should be closed.

MintSCAN exposes a fixed JPEG/PNG/PDF selection even when the selected eSCL source advertises only JPEG/PDF. It also sent scan:DocumentFormatExt for the selected MIME whenever any extension was advertised, which could send a format the source never offered. A scanner can answer unsupported ScanJobs settings with HTTP 409 while still reporting Idle.

Changes

  • Check the selected source's advertised pwg:DocumentFormat and scan:DocumentFormatExt values before a PNG job. If formats are advertised but PNG is absent, stop with a clear message rather than sending a predictable 409 or falsely producing a .png file.
  • Emit scan:DocumentFormatExt only when the exact selected MIME is advertised by that source.
  • Preserve JPEG/PDF and the behaviour of scanners with incomplete format capabilities; keep the existing compact XML and DPI/colour handling.
  • Add host-side tests for JPEG/PDF-only capabilities, PNG in the extension list, absent/ambiguous declarations, whitespace and lookalike MIME strings. make check now includes these tests.

Verification

  • The integration workflow and PR CI both completed successfully; make check passed.
  • An actual scan against the reporter's Epson XP-345 remains outstanding. If the printer advertises PNG and still returns 409, please attach its ScannerCapabilities XML and the error response to identify any format/colour or extension interaction. This does not add software-side PNG transcoding for scanners without native PNG support.

@boingball boingball mentioned this pull request Sep 18, 2026
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