library icon indicating copy to clipboard operation
library copied to clipboard

Feature/multi qr code reader

Open odahcam opened this issue 4 years ago • 6 comments

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

odahcam avatar Dec 04 '20 04:12 odahcam

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

Swiftwork avatar Dec 10 '20 11:12 Swiftwork

What massive error I did merging master onto this branch.

odahcam avatar Dec 23 '20 17:12 odahcam

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

itome avatar Apr 02 '21 07:04 itome

i love this PR.

Donhv avatar Apr 27 '21 02:04 Donhv

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

shahrin014 avatar May 20 '21 08:05 shahrin014

I made some minor fixes and created PR https://github.com/zxing-js/library/pull/464 to merge into feature/multi-qr-code-reader. Maybe you can merge that before merging this branch to master.

shahrin014 avatar Aug 11 '21 04:08 shahrin014