Skip to content

Feature/qr code scaling#1567

Open
Foxobot wants to merge 14 commits into
PhotoboothProject:devfrom
Foxobot:feature/qr-code-scaling
Open

Feature/qr code scaling#1567
Foxobot wants to merge 14 commits into
PhotoboothProject:devfrom
Foxobot:feature/qr-code-scaling

Conversation

@Foxobot

@Foxobot Foxobot commented Jun 5, 2026

Copy link
Copy Markdown

Prerequisites checklist

What is the purpose of this pull request? (put an "x" next to an item)

  • Documentation update
  • Bug fix
  • New feature
  • Other, please explain:

fixes issue #1547

What changes did you make? (Give an overview)

I added 3 new Config Parameters into print tree:

  • qrPositionMode, options:
    - absolute: nothing changes, behaviour of qr-code size and offset as before
    - relative: new parameters qrRelativeSize and qrRelativeOffset are used to scale and place the qr code on print.
  • qrRelativeSize: relative to print picture width
  • qrRelativeOffset: relative to print picture width

Inserted relative scaling and positioning into src/Image.php. Only active when qrPositionMode=relative

Is there anything you'd like reviewers to focus on?

Maybe there is a more elegant way to have the two sets of parameters in the config page (for example not showing the absolute parameters when relative is selected?)

AI used to create this Pull Request?

AI was used to navigate through the project to find the files that need changes. AI was used to give an hint how the changes can be made minimal-invasive to the existing code.

@andi34

andi34 commented Jun 6, 2026

Copy link
Copy Markdown
Contributor
npm run format
npm run composer:cgl

@reloxx13 reloxx13 force-pushed the feature/qr-code-scaling branch from 3371b46 to baf2954 Compare June 14, 2026 11:23
@reloxx13

Copy link
Copy Markdown
Collaborator

Addressed the review findings on this branch.

Fixed:

  • Relative QR sizing/offset is now based on the final cropped print dimensions instead of the pre-crop source image.
  • Theme export/import now includes print[qrPositionMode], print[qrRelativeSize], and print[qrRelativeOffset].
  • Centered relative QR placement no longer passes half-pixel coordinates into imagecopy(), so the PHP 8.4 Implicit conversion from float to int loses precision deprecation path is gone.

Tests/validation added:

  • Added PHPUnit coverage for crop-aware relative QR placement.
  • Added a PHPUnit regression test that installs an E_DEPRECATED handler and exercises a centered relative QR placement case.
  • Verified with ddev composer lint, ddev composer cgl, ddev composer phpstan, and ddev composer phpunit.

Intentional behavior choice:

  • I did not preserve text rendering above the QR code. Per product clarification, QR readability is more important than overlapping text, so QR remains on top when both are enabled.

Latest commit on the PR branch: 5f0eb4bc (fix relative QR print placement).

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.

3 participants