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

Expose barcode metadata through the API. #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Expose barcode metadata through the API. #8

wants to merge 1 commit into from

Conversation

kousu
Copy link
Contributor

@kousu kousu commented Mar 31, 2019

This lets me find out the coordinates and type of the barcodes detected. It remains backwards compatible.

Copy link
Contributor Author

@kousu kousu left a comment

Choose a reason for hiding this comment

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

Needs tests.

zxinglight/_zxinglight.cpp Show resolved Hide resolved
Copy link
Owner

@lubo lubo left a comment

Choose a reason for hiding this comment

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

Hi, @kousu. I'm so sorry it took me so long to react, I've been very busy. I've done the initial round of the review, so let me know what you think. Also, as you mentioned above, this needs tests. I can't merge it without them.

https://zxing.github.io/zxing/apidocs/com/google/zxing/Binarizer.html
"""
codes = read_codes_full(*args, **kwargs)
return [text for text, points, format in codes]
Copy link
Owner

Choose a reason for hiding this comment

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

Since this library is supposed to be lightweight, I'd rather break backward compatibility than have multiple functions, which do practically the same thing.

@@ -80,7 +81,7 @@ def read_codes(image, barcode_type=BarcodeType.NONE, try_harder=False, hybrid=Fa
multi (bool): Search for multiple barcodes in a single image.

Returns:
A list of barcode values.
A list [(code, position, type), ...] containing each barcode found.
Copy link
Owner

Choose a reason for hiding this comment

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

I'd be great if we returned namedtuples here instead of regular tuples. Working with long/nested tuples can quickly become awkward.

@kousu
Copy link
Contributor Author

kousu commented May 1, 2019 via email

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.

2 participants