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

Feature/multi qr code reader #376

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open

Conversation

odahcam
Copy link
Member

@odahcam odahcam commented Dec 4, 2020

  • 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
src/core/multi/MultipleBarcodeReader.ts Show resolved Hide resolved
@odahcam odahcam linked an issue Dec 7, 2020 that may be closed by this pull request
@Swiftwork
Copy link
Collaborator

Swiftwork commented Dec 10, 2020

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 */
}

src/core/Result.ts Outdated Show resolved Hide resolved
src/core/multi/qrcode/detector/MultiDetector.ts Outdated Show resolved Hide resolved
src/core/multi/qrcode/detector/MultiFinderPatternFinder.ts Outdated Show resolved Hide resolved
src/core/pdf417/PDF417Reader.ts Outdated Show resolved Hide resolved
src/core/qrcode/QRCodeReader.ts Outdated Show resolved Hide resolved
@odahcam
Copy link
Member Author

odahcam commented Dec 23, 2020

What massive error I did merging master onto this branch.

@itome
Copy link

itome commented Apr 2, 2021

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

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
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
Copy link

Donhv commented Apr 27, 2021

i love this PR.

@shahrin014
Copy link

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

@shahrin014
Copy link

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
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