Rename specimen Archive Master scans' (TIF images) according to the barcode detected inside.
- put the file into folder where tif files are present
- run
- all .tif files in this folder will be renamed, info is in terminal. In case the name already exists (there is more than one scan of the same specimen ID), the new name will include the original filename as a suffix.
Download from the Releases
sudo apt-get install libzbar0
python3 -m venv myenv
source myenv/bin/activate
pyinstaller --onefile --hidden-import=pyzbar.pyzbar --hidden-import=PIL --collect-binaries pyzbar barcode_rename.py
deactivatefor debugging:
python3 -m venv myenv
source myenv/bin/activate
pip install -r requirements.txt
python barcode_rename.py
deactivateLet's have a Windows with Python installed:
pip install pyinstaller pyzbar Pillowpyinstaller --onefile --hidden-import=pyzbar.pyzbar --hidden-import=PIL --collect-binaries pyzbar --add-binary "libiconv.dll;." barcode_rename.py
There should be possible to build it via Docker, but I did not found a working solution
docker run -v "$(pwd):/src/" cdrx/pyinstaller-windows:python3 bash -c "pyinstaller --onefile --specpath /src --hidden-import=pyzbar.pyzbar --add-binary \"/src/libiconv.dll;_MEIPASS\" --add-binary \"/src/libzbar64-0.dll;_MEIPASS\" barcode_rename.py"This project output was developed with financial contributions from the EOSC CZ initiative throught the project National Repository Platform for Research Data (CZ.02.01.01/00/23_014/0008787) funded by Programme Johannes Amos Comenius (P JAC) of the Ministry of Education, Youth and Sports of the Czech Republic (MEYS).

