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

UPC-A addon decoding issue #216

Open
ov opened this issue Feb 21, 2022 · 0 comments
Open

UPC-A addon decoding issue #216

ov opened this issue Feb 21, 2022 · 0 comments

Comments

@ov
Copy link

ov commented Feb 21, 2022

Hi, it looks like UPC-A addons are missed by decoder when EAN-13 reader's results are converted to UPCA. The code in MultiFormatUPCEANReader.cpp should look like this:

    if (ean13MayBeUPCA && canReturnUPCA)
    {
      // Transfer the metdata across
      QSharedPointer<Result> resultUPCA(new Result(result->getText()->substring(1),
                                        result->getRawBytes(),
                                        result->getResultPoints(),
                                        BarcodeFormat::UPC_A,
                                        {}, // default charset
                                        result->getMetadata())); // metadata with addon details
      // needs java metadata stuff
      return resultUPCA;
    }

See the two extra parameters after the BarcodeFormat::UPC_A.

Maybe something like this would also work, so we don't have to touch the charset parameter in the ctor, but I haven't tried it:

resultUPCA->getMetadata() = result->getMetadata();
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

No branches or pull requests

1 participant