xas / DataMatrix.NET

an .NET Core fork of http://datamatrixnet.sourceforge.net/
GNU Lesser General Public License v3.0
1 stars 1 forks source link

Incorrect Constants for CodeWords and Rows/Cols #1

Open davebarribeau opened 4 months ago

davebarribeau commented 4 months ago

The issues are in the DmtxConstants.cs file The smallest size DataMatrix is 8x8, which is omitted in the DmtxSymbolSize enum. While this is OK, the other int arrays of SymbolDataWords, SymbolRows, SymbolCols, DataRegionRows, and DataRegionCols include the entries for this 8x8 size. It causes a larger matrix size to be selected than what it is needed, and contributes to an image generation error. For example, encode text "12345678000001" with a module size=3 and margin=0. So either add DmtxSymbol8x8=0, to the DmtxSymbolSize enum, or else remove the incorrect int[0] elsements from the other int arrays. I don't know if the design was intended to not include the 8x8 symbol size.

gbertu commented 3 weeks ago

Hi @davebarribeau I think that this repo is died. Can you apply the fix and create a Pull Request?

xas commented 3 weeks ago

I think that the naming could be confusing.

If you take a look at the specifications page 10, it talks about a 10x10 symbol size for a 8x8 data region

So DmtxSymbolSize10x10 is named correctly on first position and there should not be any DmtxSymbolSize8x8

As I am migrating the code to a full working dotnet core, I am starting to check more deeply the data matrix specs and try to find/resolve any issues.

I will check your image generation error 👍

Thanks for your report.