feat(plustek): upgrade to pyopticfilm 1.1.2 - #958
Merged
Merged
Conversation
jboneng
marked this pull request as ready for review
August 22, 2026 17:21
This was referenced Aug 25, 2026
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
Bumps the Plustek backend to pyopticfilm 1.1.2 and adapts NegPy to the upstream API and orientation fix. Scope is the pyOpticfilm path only — no SANE, roll/feeder, or other backend changes.
pyopticfilm 1.1.2 (library)
Relevant upstream changes this PR depends on:
Added
ScanImage.rgb.DEFAULT_IMAGE_USB_PACE_S, line-aligned throttle during bulk acquire).docs/negpy-integration.md(orientation,ScanImagecontract, migration).Fixed
mirror_xmodels (8200i SE): left–right correction inImagePipeline.assemble(); prescan crop no longer applies a compensating X flip.ScanImage.ir.Changed
ScanImageslimmed to NegPy-facing fields only (rgb,dpi,device_model, optionalir). ME bracket data moved toScanner.last_me_debug(lab/debug use).Integrator notes
ScanImageME fields (rgb_short,rgb_long,exposure_*,merge_*,align_shift_*). NegPy does not consume those.NegPy changes
Dependency
pyopticfilm>=1.1.2in theplustekoptional dependency and lockfile.Orientation migration
prescan_mirror_xandcrop_to_scan_window()mirror compensation.clamp_scan_area()directly (1:1 with pyopticfilm TA coords).ScanImage.rgb/ScanImage.irfromScanner.scan()— no NegPy-side horizontal flip.Plustek backend
Scanner.open()(_ensure_quiet_usb_drain); not exposed in the UI.scanner.scan(..., infrared=capture_ir, multi_exposure=...)call replaces the old two-pass colour/IR flow and manualalign_ir_to_rgb.multi_exposurepassed through fromScanParams.Scan UI
caps.multi_exposure.ScannerSettings.Docs
docs/USER_GUIDE.md: multi-exposure control, single-pass IR, orientation/rescan note.docs/PLUSTEK_WINDOWS.md: minimum pyopticfilm 1.1.2.Unchanged
Fixes #928
Test plan
uv sync --group plustek && make test(oruv run pytest tests/scanners/ tests/test_scan_sidebar.py)