Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion pyzbar/pyzbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,21 @@ def _decode_symbols(symbols):
for index in _RANGEFN(zbar_symbol_get_loc_size(symbol))
)

# since 'polygon' is very misleading if one wants to detect the QR/bar
# code position in order no matter how they appear in the scene
polygon_upright = list(map(Point._make,(
Copy link

Choose a reason for hiding this comment

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

I find the naming more misleading now, since polygon_upright implies that it is invariant in regard to 90° rotations, which is not the case for your variant.

Also you could rename this to polygon and remove the definition above.

Choose a reason for hiding this comment

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

Please check PR #78

(
zbar_symbol_get_loc_x(symbol, index),
zbar_symbol_get_loc_y(symbol, index)
)
for index in _RANGEFN(zbar_symbol_get_loc_size(symbol))
)))

yield Decoded(
data=data,
type=symbol_type,
rect=bounding_box(polygon),
polygon=polygon
polygon=polygon_upright
)


Expand Down