Open raylutz opened 3 years ago
Hi, @raylutz Did you find any fix for this issue?
hi i have image example, that causes hard crash of python script it cant be handled in try: except block
Hi, @raylutz Did you find any fix for this issue?
No, the datamatrix code still crashes, but by wrapping it in a subprocess, it will not cause the calling program to crash. Try/Except block does not work in this example. I don't know the datamatrix code well enough to propose a change. But of course we can do a better job of clipping out the correct region and avoid the issue altogether.
Interesting find.
Using the library (dmtxread) also crashes, so the problem lies in the lib and not in the wrapper.
+++ exited with 40 +++
Adding a 10 pixel white border seems to fix the issue. Maybe someone more experienced with C code can shed light on this?
I found I had to wrap the pylibdmtx in an external subprocess (i.e. copy the source image to a file and then have a CLI envoked script that calls pylibdmtx and writes the result to a file) because this image causes everything to just hard stop, with no error messages or exceptions raised. I always treasure this sort of test data because it should be fairly easy for someone familiar with the code to fix the problem, but it isn't something I have the knowledge to do.
Enjoy!