pod-babashka-gozxing

command module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 29, 2026 License: MIT Imports: 15 Imported by: 0

README

pod-babashka-gozxing

A babashka pod for reading and writing QR codes, backed by the Go library gozxing (a port of ZXing).

This pod exists because javax.imageio.ImageIO / AWT do not work in the babashka native image (GraalVM does not ship the AWT native libraries, see oracle/graal#10951). The Go pod does image decoding and QR processing out of process.

Usage

(require '[babashka.pods :as pods])
(pods/load-pod "./pod-babashka-gozxing")
(require '[pod.babashka.gozxing :as qr])

;; encode text into a QR png
(qr/encode "https://babashka.org" "out.png")
(qr/encode "https://babashka.org" "out.png" {:size 512})

;; decode a QR from a file path
(qr/decode "out.png") ;;=> "https://babashka.org"

;; decode from raw image bytes
(require '[babashka.fs :as fs])
(qr/decode (fs/read-all-bytes "out.png"))
decode

(decode path-or-bytes) - reads a QR code from a PNG/JPEG/GIF file path or raw image bytes. Returns the decoded text. Throws if no QR code is found.

encode

(encode text path) / (encode text path opts) - writes text as a QR code PNG to path. Options:

  • :size - width/height in pixels (default 256)

Returns the output path.

Build

script/build

Test

script/test

License

Copyright © 2026 Michiel Borkent

Distributed under the MIT License. See LICENSE.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL