-
Notifications
You must be signed in to change notification settings - Fork 3
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs tests.
There was a problem hiding this 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] |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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.
No worries. I am pretty busy myself this week so I probably won't get to this right away either. But if you're patient with me we can make this happen :)
|
This lets me find out the coordinates and type of the barcodes detected. It remains backwards compatible.