Repository navigation
Fix padded iOS camera frame luminance conversion - #324
Draft
jfversluis wants to merge 1 commit into
Draft
jfversluis wants to merge 1 commit into
jfversluis wants to merge 1 commit into
Conversation
Respect CVPixelBuffer row stride and reuse shared BGRA luminance conversion. Add camera-free coverage for padded buffers and the barcode values reported in issue #323. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 10b7ac79-c541-4682-a83f-fad27551a353
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
Related to #323.
The iOS/MacCatalyst camera luminance converter assumed that BGRA rows were tightly packed. CoreVideo buffers can contain row padding, which was being interpreted as image pixels and distorting the input passed to ZXing.
CVPixelBuffer.BytesPerRowand reuse the existing stride-aware BGRA luminance helper.Reproduction and validation
A camera-free harness using the actual iOS converter source reproduced corruption: a padded 2×2 buffer returned
0, 254, 98, 254instead of0, 255, 255, 0. The corrected converter produces the expected pixels.The issue's actual barcode photographs were decoded at seven simulated resolutions each. Results were either the expected barcode or no detection; the reported incorrect values were not reproduced. This fixes a confirmed conversion bug, but its contribution to #323 remains unconfirmed and requires testing on the affected iPhone.
Device testing
The existing CI workflow uploads a NuGet artifact containing the experimental packages when its build completes. Please test both packages together on the affected device and report whether the erroneous EAN-13/UPC-A/UPC-E detections persist. This PR intentionally remains draft pending that feedback.