Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dmtxread cannot small datamatrixes #7

Open
nicolasfranck opened this issue Aug 12, 2020 · 1 comment
Open

dmtxread cannot small datamatrixes #7

nicolasfranck opened this issue Aug 12, 2020 · 1 comment

Comments

@nicolasfranck
Copy link

nicolasfranck commented Aug 12, 2020

I've played around with another datamatrix generator like https://github.com/boombuler/barcode (golang).

That generator generates datamatrixes where the dimensions are not determined
by module size or margin.

Unfortunately dmtxread cannot read them: it exits with status 1, and no error.

Other readers like https://online-barcode-reader.inliteresearch.com/ can read it.

dmtxread does work if I produce a datamatrix with the "expected" dimensions, i.e. the dimensions
dmtwrite would produce if it were to write the same input text.

My golang code that produces png (stdout!) that dmtxread can read:

package main

import (
  "image/png"
  "os"
  "github.com/boombuler/barcode"
  "github.com/boombuler/barcode/datamatrix"
  "fmt"
)

func main() {

  // Create the barcode
  code, c_err := datamatrix.Encode("hello")

  if c_err != nil {
    fmt.Println(os.Stderr,"error: %s",c_err)
    os.Exit(1)
  }

  //without this line, dmtxread fails to read it
  code,_ = barcode.Scale(code,80,80)

  // encode the barcode as png
  png.Encode(os.Stdout, code)
}

As stated: withouth scaling statement, dmtxread fails to read it.

Any idea?

See here my resulting png:

dm

@msva
Copy link
Contributor

msva commented Sep 14, 2020

Well, neither ZXing on my android smartphone was able to decode this image per se, until I placed it on white background.

I guess, they just needs some "spacing" (at least for the size of one dot-module on each side) to handle such images.

Although, it is just a guess, since I'm too busy for now to look for the real behaviour in the code and/or debug that...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants