Skip to content

Releases: Sec-ant/zxing-wasm

v2.0.0

05 Jan 16:05
52c215c
Compare
Choose a tag to compare

This release introduces a major refactoring of the underlying Embind APIs and read / write functions. Key changes include a new set of default reader options, enhanced writer capabilities backed by zint, and updated APIs for reading and writing barcodes. These changes break backward compatibility, so we are upgrading to the next major version.

Breaking Changes

Consolidated Reader Function

readBarcodes(...) replaces both readBarcodesFromImageFile(...) and readBarcodesFromImageData(...). The new function can accept either a Blob or an ImageData as its input.

Note

The v1 reader functions readBarcodesFromImageFile and readBarcodesFromImageData are still kept for a smooth migration experience, but marked as deprecated.

Updated Reader Options

A few reader options have changed their default values. This change is to align with the latest ZXing C++ library and provide a more consistent experience across different platforms:

  1. tryCode39ExtendedMode is now true by default. It was previously false.
  2. eanAddOnSymbol is now "Ignore" by default. It was previously "Read".
  3. textMode is now "HRI" by default. It was previously "Plain".

Some deprecated options have been removed, see zxing-cpp#704 for more details:

  1. validateCode39CheckSum is now removed. The Code39 symbol has a valid checksum if the third character of the symbologyIdentifier is an odd digit.
  2. validateITFCheckSum is now removed. The ITF symbol has a valid checksum if the third character of the symbologyIdentifier is a '1'.
  3. returnCodabarStartEnd is now removed. The detected results of Codabar symbols now always include the start and end characters.

eccLevel in Read Result Renamed to ecLevel

In ReadResult, the eccLevel field has been renamed to ecLevel. It now holds strings like "L", "M", "Q", or "H" or stringified numeric percentage values for error correction levels. An empty string indicates that the error correction level is not applicable.

Note

The eccLevel field is still kept for a smooth migration experience, but marked as deprecated.

Renamed & Enhanced Writer Function

writeBarcode(...) replaces writeBarcodeToImageFile(...). This function is now powered by the new zint backend which supports all available formats that are currently supported by the reader. It accepts either a string text or an Uint8Array binary data as its input for barcode generation, and provides new output formats (e.g. SVG, UTF-8) in addition to an image file blob.

The WriterOptions object has also been updated completely.

Note

The final shape of the writeBarcode function is still in review. The current implementation is subject to change.

.wasm Module Initialization / Caching Overhaul

prepareZXingModule(...) replaces both setZXingModuleOverrides(...) and getZXingModuleOverrides(...). The new function provides a more flexible way to initialize the ZXing module with custom options.

Note

The v1 module initialization functions setZXingModuleOverrides and getZXingModuleOverrides are still kept for a smooth migration experience, but marked as deprecated.

purgeZXingModule now only clears the relevant module cache from where it is imported. It no longer resets the global module cache.

Redefined BarcodeFormat-Family Types

None is removed from the BarcodeFormat union type. New types like LinearBarcodeFormat, MatrixBarcodeFormat and LooseBarcodeFormat are introduced. See barcodeFormat.ts for more details.

New Features & Enhancements

More Barcode Formats Supported in Writer

The new writeBarcode function supports more barcode formats than the previous writeBarcodeToImageFile. All barcode formats supported by the reader are now supported by the writer.

New tryDenoise Option for Reading Barcodes

The new tryDenoise option in ReaderOptions allows you to enable or disable the denoising algorithm when reading barcodes. This is an experimental feature. By default, it is set to false.

Bug Fixes

Fix TS moduleResolution: node Subpath Exports Resolution

The subpath export types are now compatible with TypeScript's moduleResolution: node strategy by using the types-versions-wildcards strategy. This package now passes all the arethetypeswrong checks.

v2.0.0-beta.4

03 Jan 17:01
011b054
Compare
Choose a tag to compare
v2.0.0-beta.4 Pre-release
Pre-release

Patch Changes

  • f8c33b2: Fix the zxing_writer.wasm size issue. See #190.

v2.0.0-beta.3

29 Dec 06:42
a80533d
Compare
Choose a tag to compare
v2.0.0-beta.3 Pre-release
Pre-release

Minor Changes

  • 615a321: - Add DXFilmEdge writing support.
    • Fix subpath exports TS compatibility with types-versions-wildcards strategy. Check this for more information.
    • Add types to .wasm subpath exports.
    • Add ImageData ambient type export.

v2.0.0-beta.2

28 Dec 17:18
eabbf38
Compare
Choose a tag to compare
v2.0.0-beta.2 Pre-release
Pre-release

Patch Changes

  • b856d58: Add typesVersions field for moduleResolution: node

v2.0.0-beta.1

25 Dec 16:11
4a8055f
Compare
Choose a tag to compare
v2.0.0-beta.1 Pre-release
Pre-release

Patch Changes

  • a10ffcc: Bump zxing-cpp to 0dfa36b to fix DataBarExpanded decoder error and ITF quiet zone detection heuristic

v2.0.0-beta.0

25 Dec 15:22
81a0468
Compare
Choose a tag to compare
v2.0.0-beta.0 Pre-release
Pre-release

Major Changes

  • 1a77296: V2: Breaking Release - Next Major Version

    This release introduces a major refactoring of the underlying Embind APIs and read / write functions. Key changes include transitioning away from Embind Enums toward numeric encoding and decoding, a new set of default reader options, enhanced writer capabilities backed by zint, and updated APIs for reading and writing barcodes. These changes break backward compatibility, so we are upgrading to the next major version.

    Breaking Changes

    Renamed & Consolidated Reader Function

    readBarcodes(...) replaces both readBarcodesFromImageFile(...) and readBarcodesFromImageData(...). The new function unifies code paths for Blob and ImageData inputs.

    [!NOTE]

    The v1 reader functions readBarcodesFromImageFile and readBarcodesFromImageData are still kept for a smooth migration experience, but marked as deprecated.

    Updated Reader Options

    A few reader options have changed their default values. This change is to align with the latest ZXing C++ library and provide a more consistent experience across different platforms:

    1. tryCode39ExtendedMode is now true by default. It was previously false.
    2. eanAddOnSymbol is now "Ignore" by default. It was previously "Read".
    3. textMode is now "HRI" by default. It was previously "Plain".

    Some deprecated options have been removed, see zxing-cpp#704 for more details:

    1. validateCode39CheckSum is now removed. The Code39 symbol has a valid checksum if the third character of the symbologyIdentifier is an odd digit.
    2. validateITFCheckSum is now removed. The ITF symbol has a valid checksum if the third character of the symbologyIdentifier is a '1'.
    3. returnCodabarStartEnd is now removed. The detected results of Codabar symbols now always include the start and end characters.

    eccLevel in Read Result Renamed to ecLevel

    In ReadResult, the eccLevel field has been renamed to ecLevel. It now holds strings like "L", "M", "Q", or "H" or stringified numeric values for error correction levels. An empty string indicates that the error correction level is not applicable.

    [!NOTE]

    The eccLevel field is still kept for a smooth migration experience, but marked as deprecated.

    Renamed & Enhanced Writer Function

    writeBarcode(...) replaces writeBarcodeToImageFile(...). The new function is powered by the new zint writer, which supports more barcode formats, supports both string and Uint8Array inputs for generating barcodes from text or binary data, and provides new output formats (e.g. SVG, UTF-8) in addition to the binary image file output.

    The WriterOptions object has also been updated completely.

    [!NOTE]

    The final shape of the writeBarcode function is still under discussion. The current implementation is subject to change.

    Module Initialization / Caching Overhaul

    prepareZXingModule(...) replaces both setZXingModuleOverrides(...) and getZXingModuleOverrides(...). The new function provides a more flexible way to initialize the ZXing module with custom options.

    [!NOTE]

    The v1 module initialization functions setZXingModuleOverrides and getZXingModuleOverrides are still kept for a smooth migration experience, but marked as deprecated.

    purgeZXingModule now only clears the relevant module cache from where it is imported. It no longer resets the global module cache.

    New Features & Enhancements

    More Barcode Formats Supported in Writer

    The new writeBarcode function supports more barcode formats than the previous writeBarcodeToImageFile. All barcode formats supported by the reader except for DXFilmEdge are now supported by the writer.

    New tryDenoise Option for Reading Barcodes

    The new tryDenoise option in ReaderOptions allows you to enable or disable the denoising algorithm when reading barcodes. This is an experimental feature and by default, it is set to false.

v1.3.5

25 Dec 15:51
114066a
Compare
Choose a tag to compare

Patch Changes

  • 2bcfd4b: Bump zxing-cpp to 0dfa36b to fix DataBarExpanded decoder error and ITF quiet zone detection heuristic

v1.3.4

07 Nov 12:34
6195081
Compare
Choose a tag to compare

Patch Changes

  • 1a9a372: Bump zxing-cpp to 579650a to fix incorrect PDF417 position info.

v1.3.3

05 Nov 17:26
7626bce
Compare
Choose a tag to compare

Patch Changes

  • 0709489: Bump zxing-cpp to cd9bba3 to fix an ITF detection regression.

v1.3.2

30 Oct 13:52
2b4d35a
Compare
Choose a tag to compare

Patch Changes

  • 4b0ca08: Bump zxing-cpp to 308f820 and improve DataBar detection rate.