View Source RqrrEx (rqrr_ex v0.1.2)

Call out to nif to detect barcodes using Rust rqrr 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: {RqrrEx.Metadata.t(), String.t()}, error: String.t()}
  | {:error, String.t()}

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

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

examples

Examples

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