Skip to content

Fix Android continuous scan result bitmap aspect ratio#467

Open
macCesar wants to merge 6 commits into
tidev:masterfrom
macCesar:fix/android-continuous-result-bitmap-aspect-ratio
Open

Fix Android continuous scan result bitmap aspect ratio#467
macCesar wants to merge 6 commits into
tidev:masterfrom
macCesar:fix/android-continuous-result-bitmap-aspect-ratio

Conversation

@macCesar

@macCesar macCesar commented May 28, 2026

Copy link
Copy Markdown

What changed

Android continuous scan mode could show the captured result image stretched after a successful scan.

The camera preview already preserves aspect ratio with a centered crop, but the scan crop still mapped the viewfinder frame against the full screen with separate X/Y scaling. This updates the frame-to-preview mapping so PlanarYUVLuminanceSource uses the same centered preview bounds that the user sees on screen.

This also changes the temporary result bitmap drawing in ViewfinderView. Instead of stretching the bitmap to fill the frame, it now draws it centered with uniform scaling. Square QR captures stay square.

The PR also updates deprecated GitHub Actions versions used by the Android and iOS workflows. GitHub now rejects actions/cache@v2 and actions/upload-artifact@v2 before the job can run.

Tested

  • Built the Android module:
    cd android/build && ./gradlew :module:compileDebugJavaWithJavac
  • Tested on a real Android device with the example app:
    example/app.js
  • Verified Scan the Code (continuous) with keepOpen: true.
  • Confirmed the captured result image is no longer distorted.
  • Confirmed the initial camera preview aspect ratio fix is still intact.

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