The following snippet generates an error:
import pyboof as pb
generator = pb.MicroQrCodeGenerator(pixels_per_module=5)
generator.set_version('M4')
Traceback (most recent call last):
File "/home/ubuntu/imperial/testing/tile/pyboof_benchmark.py", line 18, in <module>
generator.set_version('M4')
File "/home/ubuntu/imperial/testing/.venv/lib/python3.10/site-packages/pyboof/recognition.py", line 869, in set_version
self.java_encoder.setVersion(version)
File "/home/ubuntu/imperial/testing/.venv/lib/python3.10/site-packages/py4j/java_gateway.py", line 1322, in __call__
return_value = get_return_value(
File "/home/ubuntu/imperial/testing/.venv/lib/python3.10/site-packages/py4j/protocol.py", line 330, in get_return_value
raise Py4JError(
py4j.protocol.Py4JError: An error occurred while calling o43.setVersion. Trace:
py4j.Py4JException: Method setVersion([class java.lang.String]) does not exist
at py4j.reflection.ReflectionEngine.getMethod(ReflectionEngine.java:321)
at py4j.reflection.ReflectionEngine.getMethod(ReflectionEngine.java:329)
at py4j.Gateway.invoke(Gateway.java:274)
at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:132)
at py4j.commands.CallCommand.execute(CallCommand.java:79)
at py4j.GatewayConnection.run(GatewayConnection.java:238)
at java.base/java.lang.Thread.run(Thread.java:829)
I've had a quick poke through the code, and it looks like the appropriate conversion to the expected java object is missing (for both the QR and microQR generators), similar to how this method is done for set_error().
It also looks like there's a bug in the set_mask() method for both of these classes, it's calling string_to_qrcode_error() on the input parameter rather than string_to_qrcode_mask(), which I assume is the intended function, see here and here.
The following snippet generates an error:
I've had a quick poke through the code, and it looks like the appropriate conversion to the expected java object is missing (for both the QR and microQR generators), similar to how this method is done for
set_error().It also looks like there's a bug in the
set_mask()method for both of these classes, it's callingstring_to_qrcode_error()on the input parameter rather thanstring_to_qrcode_mask(), which I assume is the intended function, see here and here.