Skip to content

Feature/multi qr code reader#376

Open
odahcam wants to merge 27 commits into
masterfrom
feature/multi-qr-code-reader
Open

Feature/multi qr code reader#376
odahcam wants to merge 27 commits into
masterfrom
feature/multi-qr-code-reader

Conversation

@odahcam

@odahcam odahcam commented Dec 4, 2020

Copy link
Copy Markdown
Member
  • Added support for multiple QR code scanning from the same image.
  • Added tests for the feature.
  • Updated some classes this feature depends on.
  • Updated Sharp.

werthdavid
werthdavid previously approved these changes Dec 4, 2020
Comment thread src/core/multi/MultipleBarcodeReader.ts
@odahcam odahcam linked an issue Dec 7, 2020 that may be closed by this pull request
@Swiftwork

Swiftwork commented Dec 10, 2020

Copy link
Copy Markdown
Collaborator

Based on comments in the UPCEAN Pull-Request discussion this is where we land I think

constructor(arg1: any);
constructor(arg1: any, arg2: any);
constructor(arg1: any, arg2: any, arg3: any);
constructor(arg1: any, arg2?: any, arg3?: any) {
    if (arg2 == null) arg2 = {};
    if (arg3 == null) arg3 = {};
    return constructorImpl(arg1, arg2, arg3)
}

constructorImpl(arg1: any, arg2: any, arg3: any) {
    /* Implementation code */
}

and less preferred if more advanced logic needed

constructor(arg1: any);
constructor(arg1: any, arg2: any);
constructor(arg1: any, arg2: any, arg3: any);
constructor(arg1: any, arg2?: any, arg3?: any) {
    if (arg3 != null) return constructorImpl(arg1, arg2, arg3);
    if (arg2 != null) return constructorOverload2(arg1, arg2);
    return constructorOverload1(arg1)
}

private constructorOverload1(
    arg1: any,
) {
    return this.constructorOverload2(arg1, {});
}

private constructorOverload2(
    arg1: any,
    arg2: any,
) {
    return this.constructorImpl(arg1, arg2, {});
}

private constructorImpl(
    arg1: any,
    arg2: any,
    arg3: any,
) {
    /* Implementation code */
}

Comment thread src/core/Result.ts Outdated
Comment thread src/core/multi/qrcode/detector/MultiDetector.ts Outdated
Comment thread src/core/multi/qrcode/detector/MultiFinderPatternFinder.ts Outdated
Comment thread src/core/pdf417/PDF417Reader.ts
Comment thread src/core/qrcode/QRCodeReader.ts Outdated
@odahcam

odahcam commented Dec 23, 2020

Copy link
Copy Markdown
Member Author

What massive error I did merging master onto this branch.

@itome

itome commented Apr 2, 2021

Copy link
Copy Markdown

Any updates in this PR? I'm trying to use this branch in my project and hope this branch will be merged into master.


static processStructuredAppend( results: List<Result>): List<Result> {
const newResults: List<Result> = [];
const saResults: List<Result> = [];

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to create multiple saResults: List<Result> that grouped by ResultMetadataType.STRUCTURED_APPEND_PARITY to handle multi parity structured append qr codes in one document.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the tip!! Can you help me with some examples or a PR?

@Donhv

Donhv commented Apr 27, 2021

Copy link
Copy Markdown

i love this PR.

@shahrin014

Copy link
Copy Markdown

Also bumping this PR. Let me know how I can help.

@shahrin014

Copy link
Copy Markdown

I made some minor fixes and created PR #464 to merge into feature/multi-qr-code-reader. Maybe you can merge that before merging this branch to master.

@odahcam odahcam self-assigned this Aug 11, 2021
@werthdavid werthdavid closed this Apr 19, 2023
@werthdavid werthdavid reopened this Aug 17, 2023
Resolve conflicts to make multi-QR-code feature compatible with
current master (TS6, Jest 30, ESLint 10, Node 24, MicroQR, MaxiCode).

Conflict resolutions:
- package.json: use master's modern devDependencies
- FinderPatternFinder.ts: keep feature branch version (required by MultiFinderPatternFinder)
- src/index.ts: merge both export sets (master's CodaBar/FinderPattern + feature's multi-QR)
- createDecoder.ts: removed (consolidated into AbstractExpandedDecoderComplement on master)
- AssertUtils.ts: use master's typed assertEquals
- MultiFormatUPCEANReader.ts: keep feature branch Result constructor call (uses overloads)
- .vscode/launch.json: use master's version
- yarn.lock: use master's version

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@werthdavid

Copy link
Copy Markdown
Member

am I brave enough to merge that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Overloading Porting documentation into CONTRUBUTING.md Multiple Codes in one image

7 participants