diff -r cc60c8dd7924 -r 5bc2bb8b7946 relpipe-data/examples-barcode.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/relpipe-data/examples-barcode.xml Mon Feb 21 00:43:11 2022 +0100 @@ -0,0 +1,86 @@ + + + Reading barcodes and QR + recognize barcodes (including QR) in image files or streams + 05400 + + + +

+ Either ubiquitous 1D barcodes (procudct labels, ISBN in form of EAN-13 etc.) or 2D barcodes (QR containing hyperlinks, vCards etc.) + encode numbers, texts or other data into images that can be printed and scanned or photographed later. + Since v0.18, can interact with this technology. +

+ +

+ The relpipe-in-barcode tool reads image data from the standard input, so we can feed a file containing a barcode into it or we can generate one on-the-fly. + We can also use tee command to store generated image data in a file. +

+ + +

This pipeline generates this relation:

+ + +

+ There might be multiple barcodes (symbols) in the image file and we obtain also their sizes and positions. + We may read a photo: +

+ + + +

and get plenty of symbols:

+ + +

+ There is also (a bit experimental) example of barcode streamlet that is called from relpipe-in-filesystem + and works with several files at once (can even run in parallel, like any other streamlet): +

+ + + +

+ When we are generating QR codes and use Unicode characters (e.g. the arrow): +

+ + +

we may get unexpected result:

+ + + +

+ QR codes use the ISO 8859-1 encoding as default and readers usually do some heuristics to guess actual encoding. + Sometimes it works, sometimes not. + In this particular case, the reader accidentally thought that the encoding was SJIS. + So we can fix it by adding | iconv -t SJIS at the end of the pipeline. +

+ +

+ But this is just a workaround. + We rather want to add UTF-8 BOM or ECI (Extended Channel Interpretations) to make the reader use the same encoding as we did (UTF-8): +

+ + + +

and get desired result:

+ + +

+ Because the relpipe-in-barcode tool and the barcode-reader streamlet produce data in machine readable form, + we can use them not only for manual ah-hoc reading but also in scripts or batch processing – + e.g. extract payment information from invoices or contact information from scanned business cards, catalogize books or read package labels. +

+ + +
+ +