BardecoderEx

Hex.pm Version

Simple binding to allow using bardecoder from Elixir. Uses Rustler for bindings.

Requirements

Working Rust toolchain.

Installation

Add bardecoder_ex to your list of dependencies in mix.exs:

def deps do
  [
    {:bardecoder_ex, "~> 0.1.0"}
  ]
end

Examples

Detect and decode QR codes from a file supported by the Rust image crate.

  BardecoderEx.detect_qr_codes(File.read!("./test.png"))
  {:ok,
  [
    ok: {%{
        __struct__: Bardecoder.Metadata,
        bounds: [{474, 674}, {569, 674}, {569, 770}, {474, 770}],
        ecc_level: 1,
        modules: 41,
        version: 6
      },
      "The QR Code Content!"}
  ]}

Documentation can be found at https://hexdocs.pm/bardecoder_ex.