Decode data matrix #55

Open
opened 2024-12-30 18:52:04 +01:00 by Benjamin_Loison · 25 comments
[Wikipedia: Data Matrix](https://en.wikipedia.org/wiki/Data_Matrix) https://wasi0013.com/2019/12/17/how-to-read-data-matrix-using-python-in-linux/
Author
Owner
apt show libdmtx0a
Output:
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Package: libdmtx0a
State: not a real package (virtual)
```bash apt show libdmtx0a ``` <details> <summary>Output:</summary> ``` WARNING: apt does not have a stable CLI interface. Use with caution in scripts. Package: libdmtx0a State: not a real package (virtual) ``` </details>
Author
Owner
read_datamatrix
Output:
Command 'read_datamatrix' not found, but can be installed with:
sudo apt install python3-pylibdmtx
```bash read_datamatrix ``` <details> <summary>Output:</summary> ``` Command 'read_datamatrix' not found, but can be installed with: sudo apt install python3-pylibdmtx ``` </details>
Author
Owner
sudo apt install -y python3-pylibdmtx
Output:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  libdmtx0t64
The following NEW packages will be installed:
  libdmtx0t64 python3-pylibdmtx
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 75,4 kB of archives.
After this operation, 216 kB of additional disk space will be used.
Get:1 http://mirror.plusserver.com/ubuntu/ubuntu noble/universe amd64 libdmtx0t64 amd64 0.7.7-1.2build1 [55,5 kB]
Get:2 http://mirror.plusserver.com/ubuntu/ubuntu noble/universe amd64 python3-pylibdmtx all 0.1.10-1ubuntu1 [19,9 kB]
Fetched 75,4 kB in 0s (421 kB/s)              
Selecting previously unselected package libdmtx0t64:amd64.
(Reading database ... 964094 files and directories currently installed.)
Preparing to unpack .../libdmtx0t64_0.7.7-1.2build1_amd64.deb ...
Unpacking libdmtx0t64:amd64 (0.7.7-1.2build1) ...
Selecting previously unselected package python3-pylibdmtx.
Preparing to unpack .../python3-pylibdmtx_0.1.10-1ubuntu1_all.deb ...
Unpacking python3-pylibdmtx (0.1.10-1ubuntu1) ...
Setting up libdmtx0t64:amd64 (0.7.7-1.2build1) ...
Setting up python3-pylibdmtx (0.1.10-1ubuntu1) ...
Processing triggers for man-db (2.12.0-4build2) ...
Processing triggers for libc-bin (2.39-0ubuntu8.3) ...
```bash sudo apt install -y python3-pylibdmtx ``` <details> <summary>Output:</summary> ``` Reading package lists... Done Building dependency tree... Done Reading state information... Done The following additional packages will be installed: libdmtx0t64 The following NEW packages will be installed: libdmtx0t64 python3-pylibdmtx 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. Need to get 75,4 kB of archives. After this operation, 216 kB of additional disk space will be used. Get:1 http://mirror.plusserver.com/ubuntu/ubuntu noble/universe amd64 libdmtx0t64 amd64 0.7.7-1.2build1 [55,5 kB] Get:2 http://mirror.plusserver.com/ubuntu/ubuntu noble/universe amd64 python3-pylibdmtx all 0.1.10-1ubuntu1 [19,9 kB] Fetched 75,4 kB in 0s (421 kB/s) Selecting previously unselected package libdmtx0t64:amd64. (Reading database ... 964094 files and directories currently installed.) Preparing to unpack .../libdmtx0t64_0.7.7-1.2build1_amd64.deb ... Unpacking libdmtx0t64:amd64 (0.7.7-1.2build1) ... Selecting previously unselected package python3-pylibdmtx. Preparing to unpack .../python3-pylibdmtx_0.1.10-1ubuntu1_all.deb ... Unpacking python3-pylibdmtx (0.1.10-1ubuntu1) ... Setting up libdmtx0t64:amd64 (0.7.7-1.2build1) ... Setting up python3-pylibdmtx (0.1.10-1ubuntu1) ... Processing triggers for man-db (2.12.0-4build2) ... Processing triggers for libc-bin (2.39-0ubuntu8.3) ... ``` </details>
Author
Owner
read_datamatrix
Output:
usage: read_datamatrix [-h] [-v] image [image ...]
read_datamatrix: error: the following arguments are required: image
```bash read_datamatrix ``` <details> <summary>Output:</summary> ``` usage: read_datamatrix [-h] [-v] image [image ...] read_datamatrix: error: the following arguments are required: image ``` </details>
Author
Owner
apt show python3-pylibdmtx
Output:
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Package: python3-pylibdmtx
Version: 0.1.10-1ubuntu1
Priority: optional
Section: universe/python
Source: python-pylibdmtx
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Debian Python Team <team+python@tracker.debian.org>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 89.1 kB
Depends: libdmtx0t64, python3-pil, python3:any
Homepage: https://github.com/NaturalHistoryMuseum/pylibdmtx/
Download-Size: 19.9 kB
APT-Sources: http://mirrors.ircam.fr/pub/ubuntu/archive noble/universe amd64 Packages
Description: Read Data Matrix barcodes (Python3 version)
 Read and write Data Matrix barcodes from Python using the libdmtx library.
 .
 Features:
  * Pure Python
  * Works with PIL / Pillow images, OpenCV / numpy ndarrays, and raw bytes
  * Decodes locations of barcodes
  * No dependencies, other than the libdmtx library itself
 .
 This package contains the Python 3 version of the library.
```bash apt show python3-pylibdmtx ``` <details> <summary>Output:</summary> ``` WARNING: apt does not have a stable CLI interface. Use with caution in scripts. Package: python3-pylibdmtx Version: 0.1.10-1ubuntu1 Priority: optional Section: universe/python Source: python-pylibdmtx Origin: Ubuntu Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> Original-Maintainer: Debian Python Team <team+python@tracker.debian.org> Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 89.1 kB Depends: libdmtx0t64, python3-pil, python3:any Homepage: https://github.com/NaturalHistoryMuseum/pylibdmtx/ Download-Size: 19.9 kB APT-Sources: http://mirrors.ircam.fr/pub/ubuntu/archive noble/universe amd64 Packages Description: Read Data Matrix barcodes (Python3 version) Read and write Data Matrix barcodes from Python using the libdmtx library. . Features: * Pure Python * Works with PIL / Pillow images, OpenCV / numpy ndarrays, and raw bytes * Decodes locations of barcodes * No dependencies, other than the libdmtx library itself . This package contains the Python 3 version of the library. ``` </details>
Author
Owner

See Benjamin_Loison/xclip/issues/2.

time read_datamatrix 1280px-Datamatrix.svg.png
Output:
real	0m4,215s
user	0m4,138s
sys	0m0,070s
See [Benjamin_Loison/xclip/issues/2](https://codeberg.org/Benjamin_Loison/xclip/issues/2). ```bash time read_datamatrix 1280px-Datamatrix.svg.png ``` <details> <summary>Output:</summary> ``` real 0m4,215s user 0m4,138s sys 0m0,070s ``` </details>
Author
Owner

If replace transparency with white:

time read_datamatrix 1280px-Datamatrix.svg_white.png 
Output:
real	0m3,843s
user	0m3,742s
sys	0m0,098s
If replace transparency with white: ```bash time read_datamatrix 1280px-Datamatrix.svg_white.png ``` <details> <summary>Output:</summary> ``` real 0m3,843s user 0m3,742s sys 0m0,098s ``` </details>
Author
Owner
Related to [Benjamin_Loison/pylibdmtx/issues/3](https://codeberg.org/Benjamin_Loison/pylibdmtx/issues/3).
Author
Owner
pip install "Pillow>=3.2.0"
Output:
Collecting Pillow>=3.2.0
  Downloading pillow-11.0.0-cp312-cp312-manylinux_2_28_x86_64.whl.metadata (9.1 kB)
Downloading pillow-11.0.0-cp312-cp312-manylinux_2_28_x86_64.whl (4.4 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.4/4.4 MB 16.2 MB/s eta 0:00:00
Installing collected packages: Pillow
Successfully installed Pillow-11.0.0
```bash pip install "Pillow>=3.2.0" ``` <details> <summary>Output:</summary> ``` Collecting Pillow>=3.2.0 Downloading pillow-11.0.0-cp312-cp312-manylinux_2_28_x86_64.whl.metadata (9.1 kB) Downloading pillow-11.0.0-cp312-cp312-manylinux_2_28_x86_64.whl (4.4 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.4/4.4 MB 16.2 MB/s eta 0:00:00 Installing collected packages: Pillow Successfully installed Pillow-11.0.0 ``` </details>
Author
Owner
sudo apt purge -y python3-pylibdmtx
Output:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following package was automatically installed and is no longer required:
  libdmtx0t64
Use 'sudo apt autoremove' to remove it.
The following packages will be REMOVED:
  python3-pylibdmtx*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 89,1 kB disk space will be freed.
(Reading database ... 964137 files and directories currently installed.)
Removing python3-pylibdmtx (0.1.10-1ubuntu1) ...
Processing triggers for man-db (2.12.0-4build2) ...
```bash sudo apt purge -y python3-pylibdmtx ``` <details> <summary>Output:</summary> ``` Reading package lists... Done Building dependency tree... Done Reading state information... Done The following package was automatically installed and is no longer required: libdmtx0t64 Use 'sudo apt autoremove' to remove it. The following packages will be REMOVED: python3-pylibdmtx* 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. After this operation, 89,1 kB disk space will be freed. (Reading database ... 964137 files and directories currently installed.) Removing python3-pylibdmtx (0.1.10-1ubuntu1) ... Processing triggers for man-db (2.12.0-4build2) ... ``` </details>
Author
Owner
sudo apt autoremove -y
Output:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:
  libdmtx0t64
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 127 kB disk space will be freed.
(Reading database ... 964106 files and directories currently installed.)
Removing libdmtx0t64:amd64 (0.7.7-1.2build1) ...
Processing triggers for libc-bin (2.39-0ubuntu8.3) ...
```bash sudo apt autoremove -y ``` <details> <summary>Output:</summary> ``` Reading package lists... Done Building dependency tree... Done Reading state information... Done The following packages will be REMOVED: libdmtx0t64 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. After this operation, 127 kB disk space will be freed. (Reading database ... 964106 files and directories currently installed.) Removing libdmtx0t64:amd64 (0.7.7-1.2build1) ... Processing triggers for libc-bin (2.39-0ubuntu8.3) ... ``` </details>
Author
Owner
pip uninstall "Pillow>=3.2.0"
Output:
Found existing installation: pillow 11.0.0
Uninstalling pillow-11.0.0:
  Would remove:
    /home/benjamin/venv/lib/python3.12/site-packages/PIL/*
    /home/benjamin/venv/lib/python3.12/site-packages/pillow-11.0.0.dist-info/*
    /home/benjamin/venv/lib/python3.12/site-packages/pillow.libs/libXau-154567c4.so.6.0.0
    /home/benjamin/venv/lib/python3.12/site-packages/pillow.libs/libbrotlicommon-3ecfe81c.so.1
    /home/benjamin/venv/lib/python3.12/site-packages/pillow.libs/libbrotlidec-ba690955.so.1
    /home/benjamin/venv/lib/python3.12/site-packages/pillow.libs/libfreetype-e7d5437d.so.6.20.1
    /home/benjamin/venv/lib/python3.12/site-packages/pillow.libs/libharfbuzz-144af51e.so.0
    /home/benjamin/venv/lib/python3.12/site-packages/pillow.libs/libjpeg-45e70d75.so.62.4.0
    /home/benjamin/venv/lib/python3.12/site-packages/pillow.libs/liblcms2-e69eef39.so.2.0.16
    /home/benjamin/venv/lib/python3.12/site-packages/pillow.libs/liblzma-c9407571.so.5.6.3
    /home/benjamin/venv/lib/python3.12/site-packages/pillow.libs/libopenjp2-05423b53.so
    /home/benjamin/venv/lib/python3.12/site-packages/pillow.libs/libpng16-4cc6a9fc.so.16.44.0
    /home/benjamin/venv/lib/python3.12/site-packages/pillow.libs/libsharpyuv-898c0cb5.so.0.1.0
    /home/benjamin/venv/lib/python3.12/site-packages/pillow.libs/libtiff-0a86184d.so.6.0.2
    /home/benjamin/venv/lib/python3.12/site-packages/pillow.libs/libwebp-2fd3cdca.so.7.1.9
    /home/benjamin/venv/lib/python3.12/site-packages/pillow.libs/libwebpdemux-f2642bcc.so.2.0.15
    /home/benjamin/venv/lib/python3.12/site-packages/pillow.libs/libwebpmux-d524b4d5.so.3.1.0
    /home/benjamin/venv/lib/python3.12/site-packages/pillow.libs/libxcb-b8a56d01.so.1.1.0
Proceed (Y/n)? 
  Successfully uninstalled pillow-11.0.0
```bash pip uninstall "Pillow>=3.2.0" ``` <details> <summary>Output:</summary> ``` Found existing installation: pillow 11.0.0 Uninstalling pillow-11.0.0: Would remove: /home/benjamin/venv/lib/python3.12/site-packages/PIL/* /home/benjamin/venv/lib/python3.12/site-packages/pillow-11.0.0.dist-info/* /home/benjamin/venv/lib/python3.12/site-packages/pillow.libs/libXau-154567c4.so.6.0.0 /home/benjamin/venv/lib/python3.12/site-packages/pillow.libs/libbrotlicommon-3ecfe81c.so.1 /home/benjamin/venv/lib/python3.12/site-packages/pillow.libs/libbrotlidec-ba690955.so.1 /home/benjamin/venv/lib/python3.12/site-packages/pillow.libs/libfreetype-e7d5437d.so.6.20.1 /home/benjamin/venv/lib/python3.12/site-packages/pillow.libs/libharfbuzz-144af51e.so.0 /home/benjamin/venv/lib/python3.12/site-packages/pillow.libs/libjpeg-45e70d75.so.62.4.0 /home/benjamin/venv/lib/python3.12/site-packages/pillow.libs/liblcms2-e69eef39.so.2.0.16 /home/benjamin/venv/lib/python3.12/site-packages/pillow.libs/liblzma-c9407571.so.5.6.3 /home/benjamin/venv/lib/python3.12/site-packages/pillow.libs/libopenjp2-05423b53.so /home/benjamin/venv/lib/python3.12/site-packages/pillow.libs/libpng16-4cc6a9fc.so.16.44.0 /home/benjamin/venv/lib/python3.12/site-packages/pillow.libs/libsharpyuv-898c0cb5.so.0.1.0 /home/benjamin/venv/lib/python3.12/site-packages/pillow.libs/libtiff-0a86184d.so.6.0.2 /home/benjamin/venv/lib/python3.12/site-packages/pillow.libs/libwebp-2fd3cdca.so.7.1.9 /home/benjamin/venv/lib/python3.12/site-packages/pillow.libs/libwebpdemux-f2642bcc.so.2.0.15 /home/benjamin/venv/lib/python3.12/site-packages/pillow.libs/libwebpmux-d524b4d5.so.3.1.0 /home/benjamin/venv/lib/python3.12/site-packages/pillow.libs/libxcb-b8a56d01.so.1.1.0 Proceed (Y/n)? Successfully uninstalled pillow-11.0.0 ``` </details>
Author
Owner
pip install git+https://github.com/NaturalHistoryMuseum/pylibdmtx.git
Output:
Collecting git+https://github.com/NaturalHistoryMuseum/pylibdmtx.git
  Cloning https://github.com/NaturalHistoryMuseum/pylibdmtx.git to /tmp/pip-req-build-rszp7qyo
  Running command git clone --filter=blob:none --quiet https://github.com/NaturalHistoryMuseum/pylibdmtx.git /tmp/pip-req-build-rszp7qyo
  Resolved https://github.com/NaturalHistoryMuseum/pylibdmtx.git to commit 00a6e0691db6cd2951d5b4614a9825962f53a7ff
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: pylibdmtx
  Building wheel for pylibdmtx (pyproject.toml) ... done
  Created wheel for pylibdmtx: filename=pylibdmtx-0.1.11-py2.py3-none-any.whl size=19172 sha256=1818d8518573f2f764637a915ceb4dc1a51bf3697fe81a77f9783d9dbbdef9b9
  Stored in directory: /tmp/pip-ephem-wheel-cache-w_k97ks6/wheels/d3/c9/0a/6fab99878a6b5d399981bc70971b1bc06bfe4167b2d9d05c23
Successfully built pylibdmtx
Installing collected packages: pylibdmtx
Successfully installed pylibdmtx-0.1.11
```bash pip install git+https://github.com/NaturalHistoryMuseum/pylibdmtx.git ``` <details> <summary>Output:</summary> ``` Collecting git+https://github.com/NaturalHistoryMuseum/pylibdmtx.git Cloning https://github.com/NaturalHistoryMuseum/pylibdmtx.git to /tmp/pip-req-build-rszp7qyo Running command git clone --filter=blob:none --quiet https://github.com/NaturalHistoryMuseum/pylibdmtx.git /tmp/pip-req-build-rszp7qyo Resolved https://github.com/NaturalHistoryMuseum/pylibdmtx.git to commit 00a6e0691db6cd2951d5b4614a9825962f53a7ff Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Building wheels for collected packages: pylibdmtx Building wheel for pylibdmtx (pyproject.toml) ... done Created wheel for pylibdmtx: filename=pylibdmtx-0.1.11-py2.py3-none-any.whl size=19172 sha256=1818d8518573f2f764637a915ceb4dc1a51bf3697fe81a77f9783d9dbbdef9b9 Stored in directory: /tmp/pip-ephem-wheel-cache-w_k97ks6/wheels/d3/c9/0a/6fab99878a6b5d399981bc70971b1bc06bfe4167b2d9d05c23 Successfully built pylibdmtx Installing collected packages: pylibdmtx Successfully installed pylibdmtx-0.1.11 ``` </details>
Author
Owner
time read_datamatrix 1280px-Datamatrix.svg.png
Output:
Traceback (most recent call last):
  File "/home/benjamin/venv/bin/read_datamatrix", line 5, in <module>
    from pylibdmtx.scripts.read_datamatrix import main
  File "/home/benjamin/venv/lib/python3.12/site-packages/pylibdmtx/scripts/read_datamatrix.py", line 8, in <module>
    from pylibdmtx.pylibdmtx import decode
  File "/home/benjamin/venv/lib/python3.12/site-packages/pylibdmtx/pylibdmtx.py", line 10, in <module>
    from .wrapper import (
  File "/home/benjamin/venv/lib/python3.12/site-packages/pylibdmtx/wrapper.py", line 8, in <module>
    from packaging import version
ModuleNotFoundError: No module named 'packaging'

real	0m0,063s
user	0m0,049s
sys	0m0,014s
```bash time read_datamatrix 1280px-Datamatrix.svg.png ``` <details> <summary>Output:</summary> ``` Traceback (most recent call last): File "/home/benjamin/venv/bin/read_datamatrix", line 5, in <module> from pylibdmtx.scripts.read_datamatrix import main File "/home/benjamin/venv/lib/python3.12/site-packages/pylibdmtx/scripts/read_datamatrix.py", line 8, in <module> from pylibdmtx.pylibdmtx import decode File "/home/benjamin/venv/lib/python3.12/site-packages/pylibdmtx/pylibdmtx.py", line 10, in <module> from .wrapper import ( File "/home/benjamin/venv/lib/python3.12/site-packages/pylibdmtx/wrapper.py", line 8, in <module> from packaging import version ModuleNotFoundError: No module named 'packaging' real 0m0,063s user 0m0,049s sys 0m0,014s ``` </details>
Author
Owner

Same error after pip install "Pillow>=3.2.0".

Same error after `pip install "Pillow>=3.2.0"`.
Author
Owner
pip uninstall pylibdmtx
Output:
Found existing installation: pylibdmtx 0.1.11
Uninstalling pylibdmtx-0.1.11:
  Would remove:
    /home/benjamin/venv/bin/read_datamatrix
    /home/benjamin/venv/bin/read_datamatrix.py
    /home/benjamin/venv/bin/write_datamatrix
    /home/benjamin/venv/bin/write_datamatrix.py
    /home/benjamin/venv/lib/python3.12/site-packages/pylibdmtx-0.1.11.dist-info/*
    /home/benjamin/venv/lib/python3.12/site-packages/pylibdmtx/*
Proceed (Y/n)? 
  Successfully uninstalled pylibdmtx-0.1.11
```bash pip uninstall pylibdmtx ``` <details> <summary>Output:</summary> ``` Found existing installation: pylibdmtx 0.1.11 Uninstalling pylibdmtx-0.1.11: Would remove: /home/benjamin/venv/bin/read_datamatrix /home/benjamin/venv/bin/read_datamatrix.py /home/benjamin/venv/bin/write_datamatrix /home/benjamin/venv/bin/write_datamatrix.py /home/benjamin/venv/lib/python3.12/site-packages/pylibdmtx-0.1.11.dist-info/* /home/benjamin/venv/lib/python3.12/site-packages/pylibdmtx/* Proceed (Y/n)? Successfully uninstalled pylibdmtx-0.1.11 ``` </details>
Author
Owner
pip install pylibdmtx
Output:
Collecting pylibdmtx
  Downloading pylibdmtx-0.1.10-py2.py3-none-any.whl.metadata (5.6 kB)
Downloading pylibdmtx-0.1.10-py2.py3-none-any.whl (23 kB)
Installing collected packages: pylibdmtx
Successfully installed pylibdmtx-0.1.10
```bash pip install pylibdmtx ``` <details> <summary>Output:</summary> ``` Collecting pylibdmtx Downloading pylibdmtx-0.1.10-py2.py3-none-any.whl.metadata (5.6 kB) Downloading pylibdmtx-0.1.10-py2.py3-none-any.whl (23 kB) Installing collected packages: pylibdmtx Successfully installed pylibdmtx-0.1.10 ``` </details>
Author
Owner
time read_datamatrix 1280px-Datamatrix.svg.png
Output:
Traceback (most recent call last):
  File "/home/benjamin/venv/bin/read_datamatrix", line 5, in <module>
    from pylibdmtx.scripts.read_datamatrix import main
  File "/home/benjamin/venv/lib/python3.12/site-packages/pylibdmtx/scripts/read_datamatrix.py", line 8, in <module>
    from pylibdmtx.pylibdmtx import decode
  File "/home/benjamin/venv/lib/python3.12/site-packages/pylibdmtx/pylibdmtx.py", line 10, in <module>
    from .wrapper import (
  File "/home/benjamin/venv/lib/python3.12/site-packages/pylibdmtx/wrapper.py", line 71, in <module>
    _dmtxVersion = libdmtx_function('dmtxVersion', c_char_p)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/benjamin/venv/lib/python3.12/site-packages/pylibdmtx/wrapper.py", line 59, in libdmtx_function
    return prototype((fname, load_libdmtx()))
                             ^^^^^^^^^^^^^^
  File "/home/benjamin/venv/lib/python3.12/site-packages/pylibdmtx/wrapper.py", line 40, in load_libdmtx
    LIBDMTX = dmtx_library.load()
              ^^^^^^^^^^^^^^^^^^^
  File "/home/benjamin/venv/lib/python3.12/site-packages/pylibdmtx/dmtx_library.py", line 47, in load
    raise ImportError('Unable to find dmtx shared library')
ImportError: Unable to find dmtx shared library

real	0m0,265s
user	0m0,168s
sys	0m0,034s
```bash time read_datamatrix 1280px-Datamatrix.svg.png ``` <details> <summary>Output:</summary> ``` Traceback (most recent call last): File "/home/benjamin/venv/bin/read_datamatrix", line 5, in <module> from pylibdmtx.scripts.read_datamatrix import main File "/home/benjamin/venv/lib/python3.12/site-packages/pylibdmtx/scripts/read_datamatrix.py", line 8, in <module> from pylibdmtx.pylibdmtx import decode File "/home/benjamin/venv/lib/python3.12/site-packages/pylibdmtx/pylibdmtx.py", line 10, in <module> from .wrapper import ( File "/home/benjamin/venv/lib/python3.12/site-packages/pylibdmtx/wrapper.py", line 71, in <module> _dmtxVersion = libdmtx_function('dmtxVersion', c_char_p) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/benjamin/venv/lib/python3.12/site-packages/pylibdmtx/wrapper.py", line 59, in libdmtx_function return prototype((fname, load_libdmtx())) ^^^^^^^^^^^^^^ File "/home/benjamin/venv/lib/python3.12/site-packages/pylibdmtx/wrapper.py", line 40, in load_libdmtx LIBDMTX = dmtx_library.load() ^^^^^^^^^^^^^^^^^^^ File "/home/benjamin/venv/lib/python3.12/site-packages/pylibdmtx/dmtx_library.py", line 47, in load raise ImportError('Unable to find dmtx shared library') ImportError: Unable to find dmtx shared library real 0m0,265s user 0m0,168s sys 0m0,034s ``` </details>
Author
Owner

Same error after pip install "Pillow>=3.2.0".

Same error after `pip install "Pillow>=3.2.0"`.
Author
Owner
sudo apt install -y libdmtx0a
Output:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package libdmtx0a is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  libdmtx0t64

E: Package 'libdmtx0a' has no installation candidate
```bash sudo apt install -y libdmtx0a ``` <details> <summary>Output:</summary> ``` Reading package lists... Done Building dependency tree... Done Reading state information... Done Package libdmtx0a is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source However the following packages replace it: libdmtx0t64 E: Package 'libdmtx0a' has no installation candidate ``` </details>
Author
Owner
sudo apt install -y libdmtx0t64
Output:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  libdmtx0t64
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 55,5 kB of archives.
After this operation, 127 kB of additional disk space will be used.
Get:1 http://mirror.plusserver.com/ubuntu/ubuntu noble/universe amd64 libdmtx0t64 amd64 0.7.7-1.2build1 [55,5 kB]
Fetched 55,5 kB in 0s (243 kB/s)       
Selecting previously unselected package libdmtx0t64:amd64.
(Reading database ... 964094 files and directories currently installed.)
Preparing to unpack .../libdmtx0t64_0.7.7-1.2build1_amd64.deb ...
Unpacking libdmtx0t64:amd64 (0.7.7-1.2build1) ...
Setting up libdmtx0t64:amd64 (0.7.7-1.2build1) ...
Processing triggers for libc-bin (2.39-0ubuntu8.3) ...
```bash sudo apt install -y libdmtx0t64 ``` <details> <summary>Output:</summary> ``` Reading package lists... Done Building dependency tree... Done Reading state information... Done The following NEW packages will be installed: libdmtx0t64 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 55,5 kB of archives. After this operation, 127 kB of additional disk space will be used. Get:1 http://mirror.plusserver.com/ubuntu/ubuntu noble/universe amd64 libdmtx0t64 amd64 0.7.7-1.2build1 [55,5 kB] Fetched 55,5 kB in 0s (243 kB/s) Selecting previously unselected package libdmtx0t64:amd64. (Reading database ... 964094 files and directories currently installed.) Preparing to unpack .../libdmtx0t64_0.7.7-1.2build1_amd64.deb ... Unpacking libdmtx0t64:amd64 (0.7.7-1.2build1) ... Setting up libdmtx0t64:amd64 (0.7.7-1.2build1) ... Processing triggers for libc-bin (2.39-0ubuntu8.3) ... ``` </details>
Author
Owner
time read_datamatrix 1280px-Datamatrix.svg.png
Output:
Traceback (most recent call last):
  File "/home/benjamin/venv/bin/read_datamatrix", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/benjamin/venv/lib/python3.12/site-packages/pylibdmtx/scripts/read_datamatrix.py", line 25, in main
    from PIL import Image
ModuleNotFoundError: No module named 'PIL'

real	0m0,197s
user	0m0,161s
sys	0m0,037s

After pip install "Pillow>=3.2.0":

time read_datamatrix 1280px-Datamatrix.svg.png
Output:
real	0m4,073s
user	0m4,017s
sys	0m0,055s

Same with the white background.

pip install pylibdmtx[scripts]

leads to the same issues.

```bash time read_datamatrix 1280px-Datamatrix.svg.png ``` <details> <summary>Output:</summary> ``` Traceback (most recent call last): File "/home/benjamin/venv/bin/read_datamatrix", line 8, in <module> sys.exit(main()) ^^^^^^ File "/home/benjamin/venv/lib/python3.12/site-packages/pylibdmtx/scripts/read_datamatrix.py", line 25, in main from PIL import Image ModuleNotFoundError: No module named 'PIL' real 0m0,197s user 0m0,161s sys 0m0,037s ``` </details> After `pip install "Pillow>=3.2.0"`: ```bash time read_datamatrix 1280px-Datamatrix.svg.png ``` <details> <summary>Output:</summary> ``` real 0m4,073s user 0m4,017s sys 0m0,055s ``` </details> Same with the white background. ```bash pip install pylibdmtx[scripts] ``` leads to the same issues.
Author
Owner
read_datamatrix --help
Output:
usage: read_datamatrix [-h] [-v] image [image ...]

Reads datamatrix barcodes in images

positional arguments:
  image

options:
  -h, --help     show this help message and exit
  -v, --version  show program's version number and exit
```bash read_datamatrix --help ``` <details> <summary>Output:</summary> ``` usage: read_datamatrix [-h] [-v] image [image ...] Reads datamatrix barcodes in images positional arguments: image options: -h, --help show this help message and exit -v, --version show program's version number and exit ``` </details>
Author
Owner
from pylibdmtx.pylibdmtx import decode
from PIL import Image

print(decode(Image.open('1280px-Datamatrix.svg.png')))
Output:
Traceback (most recent call last):
  File "<tmp 1>", line 2, in <module>
    from PIL import Image
ModuleNotFoundError: No module named 'PIL'

After pip install "Pillow>=3.2.0":

[]
```python from pylibdmtx.pylibdmtx import decode from PIL import Image print(decode(Image.open('1280px-Datamatrix.svg.png'))) ``` <details> <summary>Output:</summary> ``` Traceback (most recent call last): File "<tmp 1>", line 2, in <module> from PIL import Image ModuleNotFoundError: No module named 'PIL' ``` </details> After `pip install "Pillow>=3.2.0"`: ```python [] ```
Author
Owner

Could investigate the library example images.

Could investigate the library example images.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Benjamin_Loison/linux#55
No description provided.