Skip to content

Can't use bytes to make a qrcode. #19

@coco875

Description

@coco875

I try to put bytes in input like that tiaoma.qrcode(bytes("hzbl")+int(page-i).to-bytes(endian: "big")+int(copy-i).to-bytes(endian: "big", size: 4), height: barcode-height, options: ( input-mode: 0 )) but have this error:

error: plugin panicked: wasm `unreachable` instruction executed
   ┌─ @preview/tiaoma:0.2.1/lib.typ:72:4
   │  
72 │ ╭     zint-wasm.gen_with_options(
73 │ │       cbor.encode((symbology: symbology, .._proc_options(options))),
74 │ │       data,
75 │ │     ),
   │ ╰─────^

help: error occurred in this call of function `barcode`
    ┌─ @preview/tiaoma:0.2.1/lib.typ:468:42
    │  
468 │   #let qrcode(data, options: (:), ..args) = barcode(
    │ ╭───────────────────────────────────────────^
469 │ │   data,
470 │ │   "QRCode",
471 │ │   options: options,
472 │ │   ..args,
473 │ │ )
    │ ╰─^

help: error occurred in this call of function `qrcode`
    ┌─ test/original.typ:102:26
    │
102 │             let barcode = tiaoma.qrcode(bytes("hzbl")+int(page-i).to-bytes(endian: "big")+int(copy-i).to-bytes(endian: "big", size: 4), height: barcode-height, options: ( input-mode: 0 ))
    │                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions