fix(qr): Groovy use qrencode CLI instead of ZXing
This commit is contained in:
parent
50069440b4
commit
23b47bfbf8
1 changed files with 6 additions and 6 deletions
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env groovy
|
||||
import com.google.zxing.BarcodeFormat
|
||||
import com.google.zxing.qrcode.QRCodeWriter
|
||||
|
||||
def w = new QRCodeWriter()
|
||||
def m = w.encode("unsandbox-qr-ok", BarcodeFormat.QR_CODE, 0, 0)
|
||||
println "QR:unsandbox-qr-ok:ROWS:${m.height}"
|
||||
// Use qrencode CLI via ProcessBuilder (libqrencode wrapper)
|
||||
def proc = ["qrencode", "-t", "UTF8", "-m", "0", "unsandbox-qr-ok"].execute()
|
||||
def output = proc.text
|
||||
proc.waitFor()
|
||||
def rows = output.split('\n').findAll { it.trim() }.size()
|
||||
println "QR:unsandbox-qr-ok:ROWS:${rows}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue