propose fix for tonersave queue default

This commit is contained in:
juergen committed 2026-10-20 15:42:46 +02:00
1 parent f556103f3c
commit 0b1276843f
5 files changed
+328

No files matched your search

@@ -0,0 +1,33 @@
# Spec Delta
## MODIFIED Requirements
### Requirement: Queue defaults are configurable at runtime
The container SHALL accept a `PRINTER_OPTIONS` environment variable holding
space-separated PPD option assignments (`key=value`) and apply each assignment
as a queue default on every start, so PPD-specific device options survive the
recreation of the queue. An applied assignment SHALL also determine what a job
prints: a job that does not select that option itself is printed with the
configured value, even when that value differs from the PPD's own default. A
queue default SHALL be observable for both the colour mode (`BRColorMode`) and
the toner-saving switch (`TonerSaveMode`).
#### Scenario: Options are applied on start
- **WHEN** the container is started with `PRINTER_OPTIONS="BRColorMode=Vivid TonerSaveMode=False"`
- **THEN** after startup the queue defaults include `BRColorMode=Vivid` and `TonerSaveMode=False`
#### Scenario: An applied queue default reaches the job
- **WHEN** the container is started with `PRINTER_OPTIONS="BRColorMode=Vivid TonerSaveMode=False"` and a colour job is submitted that selects neither option
- **THEN** the emitted PostScript applies `Vivid` (`UseCIEColor true`) and, provided the investigation confirms the job-level path, disables toner saving (`statusdict ... tonersave ... false`) — for `TonerSaveMode` the vendor PPD default is `False`, so the observable difference is between omitting the toner-save call and emitting `false`
#### Scenario: Defaults apply to driverless clients
- **WHEN** a macOS or iOS client prints a job that does not specify that PPD option
- **THEN** the job is printed with the configured queue default
#### Scenario: An unusable option must not stop startup
- **WHEN** `PRINTER_OPTIONS` contains an option name or value the PPD does not provide
- **THEN** the entrypoint logs a warning, applies the remaining assignments and continues starting
#### Scenario: Nothing configured
- **WHEN** `PRINTER_OPTIONS` is unset or empty
- **THEN** the queue keeps the PPD defaults and the container starts as before