View Source BardecoderEx (bardecoder_ex v0.1.0)

Call out to nif to detect barcodes using Rust bardecoder crate.

Link to this section Summary

Functions

Detect a QR code in the image provided as a binary()

Link to this section Functions

Link to this function

detect_qr_codes(image_bytes)

View Source
@spec detect_qr_codes(binary()) ::
  {:ok, ok: {BardecoderEx.Metadata.t(), String.t()}, error: String.t()}
  | {:error, String.t()}

Detect a QR code in the image provided as a binary()

Returns [{:ok, {%BardecoderEx.Metadata{}, String.t()}} | {:error, String.t()}].

examples

Examples

iex> BardecoderEx.detect_qr_codes(File.read!("./test.png"))
{:ok,
[
  ok: {%{
      __struct__: BardecoderEx.Metadata,
      bounds: [{474, 674}, {569, 674}, {569, 770}, {474, 770}],
      ecc_level: 1,
      modules: 41,
      version: 6
    },
    "The contents of the QR code!"}
]}