Repository navigation
v0.8.0
Changed
- Breaking: the whole API is now in the
qrkitmodule.qrkit/types,qrkit/error,qrkit/decode,qrkit/contentandqrkit/render/ascii,pngandsvgare removed, and so are the type aliases that re-exported their types. - Breaking:
QrCode,Decoded,VCardandCalendarEventare plain records and the render options are oneImageOptionsrecord, so their getters andwith_*setters are removed. Read fields directly and updatedefault_encode_options()ordefault_image_options()with the record update syntax. - Breaking:
new,with_*andbuildare replaced byencode_with(text, EncodeOptions).encode_splittakes labelledmax_versionanderror_correctionarguments and replacesencode_split_with. - Breaking: rendering is
to_terminal(qr, style:, margin:)withBlocks,InvertedBlocksorHalfBlocks, andto_svgandto_pngwithImageOptions.light_color: Nonegives a transparent background. The default SVG dark colour is now#000000, the same as PNG. - Breaking:
IncompatibleOptions(reason)is replaced byErrorCorrectionNotSupported(symbol, error_correction)andEciNotSupported(symbol). A pinned Micro QR version that cannot hold a character returnsUnsupportedCharacter(at_index, character). A rectangular priority on a non-rMQR symbol is ignored instead of rejected. - Breaking:
MalformedDatano longer carries a reason string. - Breaking:
WifiSecurityvariants carry the password, sowifino longer takes one forOpen. Calendar events takeTimed(start, end)withgleam/timetimestamps orAllDay(first, last)with dates, wherelastis included.gleam_timeis a new dependency. - Breaking:
package_version,module_at,MatrixAccessError,error_correction_designatorandcontent.urlare removed. - The minimum
gleam_stdlibversion is now 0.69.0 (was 0.66.0, which was never published), the first release withint.range. - Encoding a large symbol is about 2.5 times faster and PNG output about 6 times faster.
A 0.7.0 program such as
qrkit.new("12345")
|> qrkit.with_symbol(types.Micro)
|> qrkit.with_ecc(types.Low)
|> qrkit.build
|> result.map(svg.to_string)is now
qrkit.encode_with(
"12345",
qrkit.EncodeOptions(
..qrkit.default_encode_options(),
symbol: qrkit.Micro,
error_correction: qrkit.Low,
),
)
|> result.map(qrkit.to_svg(_, qrkit.default_image_options()))Fixed
-
geowrote very small or large coordinates in exponent notation (geo:1.0e-7,...). It now writes plain decimals. -
Folded vCard and iCalendar continuation lines were 76 octets long. They are now at most 75, including the leading space.
-
A calendar time outside years 1..9999 kept its month and day when the year was clamped. It is now clamped to the first or last second of that range.
-
Decoding overflowed the JavaScript stack on a long Numeric or Alphanumeric segment, such as a version 40 symbol of 7089 digits. It now reads them on both targets.
Install
gleam add qrkitSee HexDocs for the API
reference.