Add Plustek (USB) scanner backend for OpticFilm 8200i SE and enable the Scan tab on Windows - #783
Merged
Merged
Conversation
…he Scan tab on Windows
…r gate at every PPI
…nset peak after makeup, to help negpys convertion logic out
…port one bit depth
…elease this functionality would be a part of, change it so pyUSB (and libusb for windows build) is a non optional part of the frozen release build
…n't know what release this functionality would be a part of
jboneng
marked this pull request as ready for review
August 13, 2026 07:25
…sing pyOpticfilm backend
4 tasks done
marcinz606
pushed a commit
that referenced
this pull request
Aug 26, 2026
…978) PR #958 ("feat(plustek): upgrade to pyopticfilm 1.1.2") accidentally flattened the Prescan crop↔window conversion to a plain clamp, dropping the x-reflection that had been correct since the Plustek backend first shipped (#783). pyopticfilm flips the image left–right in assemble() (mirror_x, 8200i SE / 8100 V2), so the Prescan the user frames on is the mirror-corrected image while the hardware crops by sensor x. Passing the display crop straight into TA space produced correct dimensions but an x-displaced ROI — "correct crop size, offset one way". Restore the self-inverse mirror-aware conversion: - params.py: crop_to_scan_window(crop, *, mirror_x) — reflect x to (1-x2, y1, 1-x1, y2) when mirrored, passthrough otherwise. - base.py / plustek_backend.py: re-add prescan_mirror_x capability, wired from model.mirror_x. - prescan_dialog.py: apply the conversion at all three crop↔window points. Tests: x-reflection, passthrough, self-inverse for crop_to_scan_window, and prescan_mirror_x surfaced on 8100 V2 caps. Verified on hardware (OpticFilm 8100 V2): a Prescan crop now lands exactly where drawn.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a first-party Plustek (USB) scanner backend and enables the Scan tab on Windows by integrating the external pyopticfilm driver (PyUSB / libusb) for the OpticFilm series.
Until now, film-scanner acquisition went only through SANE (
python-sane), which is unavailable on Windows, so the Scan UI was a placeholder there. This PR:negpy/infrastructure/scanners/plustek_backend.py(sameScannerBackend/ScanResultpattern as SANE)ScanSidebaron WindowsScannerCapabilities(prescan_dpi,prescan_mirror_x,prescan_default_crop) and shared helpers inparams.pypyopticfilminstallSupported scan hardware today: Plustek OpticFilm 8200i SE only (
07b3:1825, GL128). Other OpticFilm PIDs may enumerate/probe but are locked out of scan until validated.Driver packaging: device-specific code lives in pyopticfilm (PyPI
>=1.0, currently 1.1.1). NegPy does not vendor the driver tree.Backend selection
plusteksanePersisted
backend: "sane"on Windows is coerced toplustekon load so old settings do not try to open python-sane.Architecture
ScanSidebar → ScanWorker → ScannerService → create_backend("plustek") → PlustekBackend (adapter) → pyopticfilm.Scanner → pyusb / libusb-package
capture_iris enabled; IR is registered to RGB with whole-pixel phase correlation after the carriage re-homesScannerUnavailablewith install / WinUSB hint (soft fail; app still runs)TransientScanError(ScannerService retries)plustek_backend.pymay importpyopticfilmSE capture quality (post-landing fixes on this branch)
~/.cache/pyopticfilm/); NegPy adapter cache underplustek_calib/— seedocs/PLUSTEK_WINDOWS.mdtroubleshootingScan UI capability gating
Controls appear only when the selected device reports a real choice / feature:
caps.autofocus(SANE when"autofocus" in opt; Plustek SE = false)caps.auto_exposure(SANEae; Plustek SE = false)len(supported_depths) > 1(Plustek SE is 16-bit only → hidden; sole depth still sent in scan params)caps.prescan(8200i SE: 1200 dpi preview, interactive crop)Packaging
pyopticfilmon PyPI (not in-tree)Docs
Known follow-ups (out of scope)
-Non-SE OpticFilm models: enumerate but do not scan until validated in pyopticfilm
Future ToDos
Test plan