@zxing/library

WebJar for @zxing/library

License

License

MIT
Categories

Categories

JavaScript Languages ZXing Data Data Formats Image Processing
GroupId

GroupId

org.webjars.bowergithub.zxing-js
ArtifactId

ArtifactId

library
Last Version

Last Version

0.8.2
Release Date

Release Date

Type

Type

jar
Description

Description

@zxing/library
WebJar for @zxing/library
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/zxing-js/library

Download library

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.bowergithub.zxing-js/library/ -->
<dependency>
    <groupId>org.webjars.bowergithub.zxing-js</groupId>
    <artifactId>library</artifactId>
    <version>0.8.2</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bowergithub.zxing-js/library/
implementation 'org.webjars.bowergithub.zxing-js:library:0.8.2'
// https://jarcasting.com/artifacts/org.webjars.bowergithub.zxing-js/library/
implementation ("org.webjars.bowergithub.zxing-js:library:0.8.2")
'org.webjars.bowergithub.zxing-js:library:jar:0.8.2'
<dependency org="org.webjars.bowergithub.zxing-js" name="library" rev="0.8.2">
  <artifact name="library" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bowergithub.zxing-js', module='library', version='0.8.2')
)
libraryDependencies += "org.webjars.bowergithub.zxing-js" % "library" % "0.8.2"
[org.webjars.bowergithub.zxing-js/library "0.8.2"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.bowergithub.adriengibrat : ts-custom-error jar [2.2.1,3)

Project Modules

There are no modules declared in this project.

ZXing

Runs on your favorite ECMAScript ecosystem

If it doesn't, we gonna make it.

What is ZXing?

ZXing ("zebra crossing") is an open-source, multi-format 1D/2D barcode image processing library implemented in Java, with ports to other languages.

Supported Formats

See Projects and Milestones for what is currently done and what's planned next. ๐Ÿ‘€

1D product 1D industrial 2D
UPC-A Code 39 QR Code
UPC-E Code 93 Data Matrix
EAN-8 Code 128 Aztec
EAN-13 Codabar PDF 417
ITF MaxiCode
RSS-14
RSS-Expanded *

* In progress, may have open PR.

Status

Build Status Dependencies Greenkeeper badge

NPM version npm Contributors Commits to deploy

Codacy Badge Maintainability Test Coverage BCH compliance

Demo

See Live Preview in browser.

Note: All the examples are using ES6, be sure is supported in your browser or modify as needed, Chrome recommended.

Installation

npm i @zxing/library --save

or

yarn add @zxing/library

Limitations

On iOS-Devices with iOS < 14.3 camera access works only in native Safari and not in other Browsers (Chrome,...) or Apps that use an UIWebView or WKWebView. This is not a restriction of this library but of the limited WebRTC support by Apple. The behavior might change in iOS 11.3 (Apr 2018?, not tested) as stated here

iOS 14.3 (released in december 2020) now supports WebRTC in 3rd party browsers as well ๐ŸŽ‰

Browser Support

The browser layer is using the MediaDevices web API which is not supported by older browsers.

You can use external polyfills like WebRTC adapter to increase browser compatibility.

Also, note that the library is using the TypedArray (Int32Array, Uint8ClampedArray, etc.) which are not available in older browsers (e.g. Android 4 default browser).

You can use core-js to add support to these browsers.

In the PDF 417 decoder recent addition, the library now makes use of the new BigInt type, which is not supported by all browsers as well. There's no way to polyfill that and ponyfill libraries are way to big, but even if PDF 417 decoding relies on BigInt the rest of the library shall work ok in browsers that doesn't support it.

There's no polyfills for BigInt in the way it's coded in here.

Usage

// use with commonJS
const { MultiFormatReader, BarcodeFormat } = require('@zxing/library');
// or with ES6 modules
import { MultiFormatReader, BarcodeFormat } from '@zxing/library';

const hints = new Map();
const formats = [BarcodeFormat.QR_CODE, BarcodeFormat.DATA_MATRIX/*, ...*/];

hints.set(DecodeHintType.POSSIBLE_FORMATS, formats);

const reader = new MultiFormatReader();

reader.setHints(hints);

const luminanceSource = new RGBLuminanceSource(imgByteArray, imgWidth, imgHeight);
const binaryBitmap = new BinaryBitmap(new HybridBinarizer(luminanceSource));

reader.decode(binaryBitmap);

Contributing

See Contributing Guide for information regarding porting approach and reasoning behind some of the approaches taken.

Contributors

Special thanks to all the contributors who have contributed for this project. We heartly thankful to you all.

And a special thanks to @aleris who created the project itself and made available the initial QR code port.


Bless

org.webjars.bowergithub.zxing-js

ZXing for JS

Things written in JavaScript / TypeScript to run in JavaScript / TypeScript. ๐Ÿ˜€

Versions

Version
0.8.2