zint / zint-gpl-only

Zint Barcode Generator
https://zint.org.uk/
GNU General Public License v3.0
522 stars 137 forks source link

Data Matrix encoding issue #85

Closed MSBluhm closed 2 years ago

MSBluhm commented 2 years ago

Hi there,

my colleague and I are currently working on a layouting software and we use Zint to visualize barcodes.

When trying different contents in the Data Matrix (DMC) noticed that the optimal calculation in conjunction with the Base256 encoding is faulty.

Version used: 2.10.0 Example:

 DMC size: 18x18
 value: öööhelloworld123456
 bytes: 18
 character: 19

 DMC size: 18x18
 value: helloworld1234567890ööö
 bytes: 18
 characters: 23

We have found that in the first case the Base256 encoding up to the "w" and only then does the change to ASCII.

Shouldn't the Base256 encoding end after the third "ö" to get the optimal character length?

ZintImageFailure ZintImageOptimum ZintImageWithoutFailure

gitlost commented 2 years ago

Hi thanks for reporting this. This fork is not in use - if you open a ticket on the source forge site https://sourceforge.net/p/zint/tickets/ then it will be seen by the developers, thanks.

gitlost commented 2 years ago

Hi trying the first example "öööhelloworld123456" in the latest version of Zint it does encode as you suggest, ending the Base256 encodation after the third "ö", i.e. "BBBTTTTTTTTTAAAAAAA". The optimization method for Data Matrix was fairly recently changed to use a Dijkstra-based algorithm which should give optimal (or near optimal) results so it's likely you were using an earlier version of Zint. If this is still an issue or you've any further feedback, please see previous comment, thanks, am closing now.