OUDON / rmqrcode-python

Rectangular Micro QR Code (rMQR Code) Generator in Python
https://pypi.org/project/rmqrcode/
Other
158 stars 16 forks source link

Incorrect optimization #29

Closed OUDON closed 2 years ago

OUDON commented 2 years ago

Bug in the SegmentOptimizer.

Summary

A cost computed by SegmentOptimizer is too small in Byte Mode. This bug causes invalid segmentation.

Current Behaviour

>>> qr._optimized_segments("点茗")
[{'data': '点茗', 'encoder_class': <class 'rmqrcode.encoder.byte_encoder.ByteEncoder'>}

Expected Behaviour

>>> qr._optimized_segments("点茗")
[{'data': '点茗', 'encoder_class': <class 'rmqrcode.encoder.byte_encoder.KanjiEncoder'>}