Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix iOS wrapper default hints' maxNumberOfSymbols #507

Merged
merged 1 commit into from Feb 2, 2023

Conversation

kientux
Copy link
Contributor

@kientux kientux commented Feb 2, 2023

In iOS wrapper, ZXIDecodeHints already has a property of maxNumberOfSymbols but it is not synced with underlying ZXing::DecodeHints. It is used only to explicit set hints in ZXIBarcodeReader.

So because of default value of NSInteger in Objective-C is 0, if client does not explicitly set its value then reader will produce no result at all.

This issue only happens if formats is set to [ANY] or both [LINEAR_CODES, MATRIX_CODES]. It works just fine for single [LINEAR_CODES] format. I guess it related to some logics behind zxing-cpp.

@axxel axxel merged commit 222e89c into zxing-cpp:master Feb 2, 2023
axxel added a commit that referenced this pull request Feb 4, 2023
Explicitly setting `maxNumberOfSymbols` to 0 results in 0 detections which
makes no sens in any case. Now we reinterpret 0 as `INT_MAX` which
effectively means 'unlimited'.

This is somewhat related to #507.
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.

None yet

2 participants