DataMatrix encoder extension

Bug #465571 reported by inductiveload
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Wishlist
Unassigned

Bug Description

I have created a new extnesion for encoding DataMatrix 2D barcodes from a given text.

This extension renders a DataMatrix 2D barcode, as specified in
BS ISO/IEC 16022:2006. Only ECC200 codes are considered, as these are the only
ones recommended for an "open" system.

The size of the DataMatrix is variable between 10x10 to 144x144, encoding up to 3116
digits or 1558 alpha numberic characters.

The absolute size of the DataMatrix modules (the little squares) is also
variable.

If more data is given than can be contained in one DataMatrix,
more than one DataMatrices will be produced.

Text is encoded as ASCII (the standard provides for other options, but these are
not implemented). Consecutive digits are encoded in a compressed form, halving
the space required to store them.

Note: the 144x144 matrix is a special case, and may or may not work. I cannot test the output of this script, as the decoders I have used seem incapable of decoding _any_ matrices of this size.

Related branches

Revision history for this message
inductiveload (inductiveload) wrote :
Revision history for this message
inductiveload (inductiveload) wrote :

By the way: as 2D barcodes are radically different to normal barcodes, it would be too hard to use the existing barcode generation routines to render these matrices.

description: updated
tags: added: extensions-plugins
Revision history for this message
Alvin Penner (apenner) wrote :

- just tried out the bar code, works well for me, very nice work!
- of course I don't know what they are supposed to look like, is there a reference that would give a quick 5 minute introduction?
- Is there a relationship between the number of letters of text and the numbers of rectangles produced?
- I can't seem to control the original placement position of the code, would it be possible to draw it inside a selected object like a rectangle?

Revision history for this message
Alvin Penner (apenner) wrote :

okay, I retract the last comment, I see that it is possible to do some positioning by scrolling the screen, never noticed that before, this works reasonably well, and is consistent with the positioning of the original barcode, as far as I can tell.

su_v (suv-lp)
Changed in inkscape:
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
inductiveload (inductiveload) wrote :

I suppose the first reference would be http://en.wikipedia.org/wiki/Datamatrix

And no, the user selects the size of the matrix. If it is too small, the script will generate multiple datamatrices to hold the data.

As for the positioning, the standard extension behaviour seems to be to place in the centre of the screen. As datamatrices are always a fixed aspect ratio (most are square), I tihnk it is easier to just specifiy the module (little squares) size.

Revision history for this message
Rob Antonishen (rob-antonishen) wrote :

How difficult would it be to extend to QR codes?

Alvin Penner (apenner)
Changed in inkscape:
status: Confirmed → Fix Committed
jazzynico (jazzynico)
Changed in inkscape:
milestone: none → 0.48
Revision history for this message
inductiveload (inductiveload) wrote :

Hi Rob, QR codes are very different creatures to DataMatrices, only the superficial appearance of black and white squares is shared. I was going to have a look at QR codes, but I couldn't get hold of the specification. Maybe I'll try again one day, but it's just too much work for me to consider now, as all the routines except the easy ones for actually drawing the squares need to be reinvented for the QR case! If you manage to get hold of the QR code spec, let me know and I'll have another look. Regards, inductiveload.

Revision history for this message
su_v (suv-lp) wrote :

I just noticed that the 'Barcode - Datamatrix…' extension (used with default values) causes a lot of console messages (the same message is repeated 2 times for each created rectangle):

** (inkscape-bin:69263): WARNING **: Invalid style property id: 23 value: 1

Can you look into this why it is happening and if the warning can be avoided?

tested with Inkscape 0.47+devel r9025 (Python 2.6.2) and r9261 (Python 2.5.1) on OS X 10.5.8
(the extension was committed in rev. 8905)

Revision history for this message
Alvin Penner (apenner) wrote :

thanks, patch committed to bzr rev 9263. I replaced the style property 'width' with 'stroke-width'

jazzynico (jazzynico)
Changed in inkscape:
status: Fix Committed → Fix Released
Revision history for this message
su_v (suv-lp) wrote :

Rob Antonishen wrote on 2009-12-21:
> How difficult would it be to extend to QR codes?

Added in r9884 and r9885 to Inkscape trunk by bbyak:
<http://article.gmane.org/gmane.comp.graphics.inkscape.devel/35330>

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.