Releases: Sec-ant/zxing-wasm
Release list
v3.1.2
v3.1.1
Patch Changes
- c4b1d38: upgrade zxing-cpp to v3.1.0-3-g6c2961d2 and rewrite blackbox test infrastructure with YAML snapshots and upstream contract validation
v3.1.0
Minor Changes
- 689dc7d: Bump zxing-cpp to
f5adf687, enabling MicroPDF417 reading and Telepen support, and refresh format metadata, docs, and tests.
v3.0.3
Patch Changes
-
9ba11f0: Bump
zxing-cppsubmodule fromb304f665to1681c2e7(43 commits) and refresh dev dependencies.Notable upstream improvements pulled in:
- DataMatrix detector: timing-pattern-based correction for deformed symbols, LocalGrid-based alignment evaluation, better dimension estimation.
- Aztec detector: timing-pattern parsing, more forgiving
isTimingPatternCross, finer LocalGrid adjustment, more robust mode-message parsing. - QR detector: fixes for a
TraceLinedeadlock (#1087) and undefined behavior inCenterOfRing; better small-symbol throughput. - Crash/UB fixes: PDF417 heap-buffer-overflows, AZDecoder crash on empty Structured Append, ODCode39
DecodeCode32exception, DataBarout_of_range.
User-visible effects: one previously undetected Aztec sample (
aztec-2/20.png) is now decoded across all rotations; corner positions of many barcodes shift by 1–2 pixels andsymbol.datahashes change accordingly. Decodedtextandbytesare bit-identical for every previously-passing test.
v3.0.2
Patch Changes
- 304e0ae: Bump zxing-cpp submodule to
b304f665. Upgrade emscripten to v5.0.4. Update all dependencies including vite 8, typescript 6, and vitest 4.1. Replace babel-based emscripten JS patching with a lightweight vite transform plugin.
v3.0.1
v3.0.0
Major Changes
-
0d992cb: Upgrade zxing-cpp to
9a9ccb83(v3.0.2).Breaking Changes
Barcode format values changed
ReadResult.formathas changed to match zxing-cpp's new canonical naming:"EAN-8"→"EAN8""EAN-13"→"EAN13""UPC-A"→"UPCA""UPC-E"→"UPCE""DataBarExpanded"→"DataBarExp""DataBarLimited"→"DataBarLtd""rMQRCode"→"RMQRCode"
Code that compared
ReadResult.formatagainst the old string values (e.g.result.format === "EAN-13") will no longer match.Format sub-variants now distinguished
The reader now returns specific sub-variant format names instead of the base symbology name. For example:
"DataBar"→"DataBarOmni"or"DataBarStk"(depending on the specific variant detected)"DataBarExpanded"→"DataBarExp"or"DataBarExpStk""Code39"→"Code39Ext"(when extended ASCII characters are present)
Code that matched against base names like
result.format === "DataBar"will no longer match for omnidirectional or stacked variants. Use the newReadResult.symbologyfield (e.g.result.symbology === "DataBar") to match by symbology family, or update format checks to include the new variant names.The reader may also return entirely new format names that did not exist before:
"Code32","PZN","ITF14","DataBarStkOmni","QRCodeModel1","ISBN","AztecRune","EAN5","EAN2", etc.symbol.datapixel polarity invertedThe pixel values in
ReadResult.symbol.dataandWriteResult.symbol.data(Uint8ClampedArray) have been inverted:- Before: black (foreground) =
0xFF, white (background) =0x00 - After: black (foreground) =
0x00, white (background) =0xFF
The new behavior follows standard luminance convention (0 = black, 255 = white). Code that consumes
symbol.datato render or process barcode images will need to be updated.Format input names changed
The old meta-format names
"Linear-Codes","Matrix-Codes", and"Any"are now accepted as deprecated aliases for"AllLinear","AllMatrix", and"All"respectively. They will continue to work but should be migrated to the new names.Old format names like
"EAN-13"and"UPC-A"are now accepted as human-readable labels (HRI labels), so they continue to work as inputs forReaderOptions.formats. However, the old"DataBarExpanded","DataBarLimited", and"rMQRCode"are only accepted as deprecated aliases — use"DataBarExp","DataBarLtd", and"RMQRCode"instead.barcodeFormatscontent changedThe
barcodeFormatsarray (now deprecated in favor ofBARCODE_FORMATS) changed from 23 entries to 40+ entries. All new sub-variant formats are included, hyphenated names are replaced with canonical names, and"None"has been removed. Code that indexed into the array by position, checked its.length, or iterated over it expecting the old entries will break.The same applies to
linearBarcodeFormats(nowLINEAR_BARCODE_FORMATS) andmatrixBarcodeFormats(nowMATRIX_BARCODE_FORMATS).ReadResult.eccLevelremovedThe deprecated
eccLevelfield has been removed fromReadResult. UseecLevel(which is itself now deprecated in favor ofextra).WriterOptions.scaledefault changedThe default value of
WriterOptions.scalechanged from0to1. Previously0meant "unset" and was resolved internally; now1is the explicit default module size.WriterOptions.withHRTandwithQuietZonesrenamedwithHRTandwithQuietZonesonZXingWriterOptions(the internal interface) have been replaced byaddHRTandaddQuietZones. The user-facingWriterOptionsstill accepts the old names as deprecated aliases (preferring the new names when both are provided).TextModevalues reorderedThe
textModesarray (now deprecated in favor ofTEXT_MODES) order changed from["Plain", "ECI", "HRI", "Hex", "Escaped"]to["Plain", "ECI", "HRI", "Escaped", "Hex", "HexECI"]."Hex"and"Escaped"swapped positions, and"HexECI"was added. Code that indexed into thetextModesarray by position will break.Note: users who set
textModeby string value (e.g.textMode: "HRI") are not affected.CharacterSetduplicate removedA duplicate
"UTF16BE"entry was removed from thecharacterSetsarray (now deprecated in favor ofCHARACTER_SETS), reducing its length from 35 to 34 and shifting all entries after position 29. Code that indexed into thecharacterSetsarray by position will break.Note: users who set
characterSetby string value (e.g.characterSet: "UTF8") are not affected.WriterOptionsfields restructuredreaderInit,forceSquareDataMatrix,ecLevel, andsizeHinthave been removed fromZXingWriterOptions(the internal C++ interface). They are still accepted on the user-facingWriterOptionsas deprecated fields and are translated into theoptionsstring orscalevalue automatically.New Features
Symbology system
ReadResult.symbology: New field that returns the symbology family name. For example, reading an EAN-13 barcode returnsformat: "EAN13"andsymbology: "EANUPC". This allows grouping results by symbology family.- New variant formats: The reader now distinguishes sub-formats within symbology families:
- Code39 →
Code39,Code39Std,Code39Ext,Code32,PZN - ITF →
ITF,ITF14 - DataBar →
DataBar,DataBarOmni,DataBarStk,DataBarStkOmni,DataBarLtd,DataBarExp,DataBarExpStk - EAN/UPC →
EANUPC,EAN13,EAN8,EAN5,EAN2,ISBN,UPCA,UPCE - PDF417 →
PDF417,CompactPDF417,MicroPDF417 - Aztec →
Aztec,AztecCode,AztecRune - QRCode →
QRCode,QRCodeModel1,QRCodeModel2,MicroQRCode,RMQRCode - Other →
OtherBarcode,DXFilmEdge
- Code39 →
ReadResult.extraexpandedThe
extraJSON string now includesECLevelfor barcode types that support error correction: QR codes, MicroQR codes, Aztec, PDF417, and rMQR codes. For Aztec and PDF417, which previously had emptyextrastrings, this is entirely new metadata.Meta-formats
New meta-format groupings for
ReaderOptions.formats:"All","AllReadable","AllCreatable","AllLinear","AllMatrix","AllGS1","AllRetail","AllIndustrial".Format input flexibility
ReaderOptions.formatsandWriterOptions.formatnow accept:- Canonical names (e.g.
"QRCode","EAN13") - Human-readable labels (e.g.
"QR Code","EAN-13","Code 128") - Meta-format names (e.g.
"All","AllLinear") - Deprecated aliases (e.g.
"DataBarExpanded","Any")
WriterOptions.invertNew option to invert the colors of the generated barcode.
WriterOptions.optionskeys expandedThe
optionsstring (which was already available but experimental) now supports additional keys:eci,readerInit,ecLevel,rows,columns. The@experimentaltag has been removed.ReaderOptions.validateOptionalChecksumNew option to validate optional checksums where applicable (e.g. Code39, ITF).
TextMode"HexECI"New text mode that transcodes
ReadResult.bytesECIto an ASCII string of hex values.Barcode format utilities
New exported functions and constants:
- Functions:
encodeFormat(),encodeFormats(),symbologyToFormats(),formatToSymbology(),formatToLabel() - Constants:
BARCODE_FORMATS,BARCODE_HRI_LABELS,BARCODE_META_FORMATS,BARCODE_SYMBOLOGIES,LINEAR_BARCODE_FORMATS,MATRIX_BARCODE_FORMATS,READABLE_BARCODE_FORMATS,CREATABLE_BARCODE_FORMATS,GS1_BARCODE_FORMATS,RETAIL_BARCODE_FORMATS,INDUSTRIAL_BARCODE_FORMATS,TEXT_MODES,CHARACTER_SETS,BINARIZERS,CONTENT_TYPES,EAN_ADD_ON_SYMBOLS - Types:
BarcodeFormat,BarcodeHRILabel,BarcodeMetaFormat,BarcodeSymbology,LinearBarcodeFormat,MatrixBarcodeFormat,ReadableBarcodeFormat,CreatableBarcodeFormat,GS1BarcodeFormat,RetailBarcodeFormat,IndustrialBarcodeFormat,LooseBarcodeFormat,ReadInputBarcodeFormat,WriteInputBarcodeFormat,ReadOutputBarcodeFormat
Expanded write support
Many more formats are now writable via the integrated zint library, including:
Code39Ext,Code32,PZN,ITF14, all DataBar variants,EANUPC,EAN5,EAN2,ISBN,DXFilmEdge,CompactPDF417,MicroPDF417,Aztec,AztecRune,QRCodeModel2,MicroQRCode,RMQRCode,MaxiCode.Deprecations
The following are deprecated and will be removed in a future major version:
ReadResult.ecLevel→ parse fromReadResult.extraReadResult.readerInit→ parse fromReadResult.extraReadResult.version→ parse fromReadResult.extraWriterOptions.withHRT→ useaddHRTWriterOptions.withQuietZones→ useaddQuietZonesWriterOptions.readerInit→ useoptions: "readerInit"WriterOptions.forceSquareDataMatrix→ useoptions: "forceSquare"WriterOptions.ecLevel→ useoptions: "ecLevel=<value>"WriterOptions.sizeHint→ use negativescalevalueReaderOptions.tryCode39ExtendedMode→ useCode39Ext/Code39Stdformat names- Format alias
"DataBarExpanded"→ use"DataBarExp" - Format alias
"DataBarLimited"→ use"DataBarLtd" - Format alias
"Linear-Codes"→ use"AllLinear" - Format alias
"Matrix-Codes"→ use"AllMatrix" - Format alias
"Any"→ use"All" barcodeFormats→ useBARCODE_FORMATS- `linearBarcodeFormat...
v2.2.4
Patch Changes
- 1cf308c: Replace
Array.prototype.entrieswith the good old index-based for loops.
v2.2.3
Patch Changes
- f325c8c: Bump zxing-cpp to
fba4e95with a newly pinned zint version and some internal tweaks. Updated dependencies. Bump emscripten to v4.0.19, which fixes the uncatchable error on WASM initialization in this lib.
v2.2.2
Patch Changes
- c12d2fe: Bump deps and switch to OIDC trusted publishing