Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#1024731: Acknowledgement (python3-pylibdmtx: The decode procedure truncates the decoded byte-string at null character)

33 views
Skip to first unread message

Wojciech Zabołotny

unread,
Nov 24, 2022, 5:31:35 AM11/24/22
to
Of course in my workaround.py there was a mistake. Instead of:

    img.save("code.png")

there should be:

   ic.save("code.png")

--

Regards,
Wojtek

W dniu 24.11.2022 o 11:14, Wojciech Zabołotny pisze:
> Based on the fact that dmtxread correctly handles decoding of data
> containing null bytes I have created a temporary workaround.
> The result of decoding in Python is used only to identify the
> rectangle containing the code.
>
> That rectangle is then saved to the file and os.system is used to
> decode it with dmtxread.
>
> It is a "quick & dirty" solution, but at least works...
>
workaround.py

Wojciech Zabołotny

unread,
Nov 24, 2022, 7:00:05 AM11/24/22
to
I have tested my workaround on a bigger image with the code and found
that pydmtx reverses the coordinates.
Calculation of the box used to export the code must be more complicated:

    # We need to introduce certain margin when exporting the rectangle
with the code
    margin = 10
b=(r.left-margin,img.size[1]-r.top-r.height-margin,r.left+r.width+margin,img.size[1]-r.top+margin)

--

Regards,
Wojtek

workaround.py
0 new messages