Socket
Socket
Sign inDemoInstall

@gammastream/qrcode-poly-reader

Package Overview
Dependencies
1
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @gammastream/qrcode-poly-reader

Finds multiple QR Codes in an image utilizing jsQR under the hood.


Version published
Weekly downloads
3
increased by200%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

QRCode Poly-reader

Finds multiple QR Codes in an image utilizing jsQR under the hood.

Why?

The main purpose of this poly-reader is find QR codes in multiple regions of a scanned document.

logo GammaStream

Getting Started

To install, execute the following command from the root of your project:

npm install @gammastream/qrcode-poly-reader --save

Then, use it like this in Typescript:

import * as fs from "fs-extra";
import * as UPNG from "upng-js";
import {polyReader} from '@gammastream/qrcode-poly-reader';


loadPng('./tests/artifacts/test-0.png').then((img) => {
    const results = polyReader(img.data, img.width, img.height);
    console.log( results );
});

async function loadPng(path) {
    const data = UPNG.decode(await fs.readFile(path));
    const out: {
      data: Uint8ClampedArray,
      width: number,
      height: number,
    } = {
      data: new Uint8ClampedArray(UPNG.toRGBA8(data)[0]),
      width: data.width,
      height: data.height,
    };
    return out;
  }

Or like this, in Javascript:

const fs = require('fs-extra');
const UPNG = require('upng-js');
const reader = require('@gammastream/qrcode-poly-reader');


loadPng('./test-0.png').then((img) => {
    const results = reader.polyReader(img.data, img.width, img.height);
    console.log( results );
});

async function loadPng(path) {
    const data = UPNG.decode(await fs.readFile(path));
    return {
        data: new Uint8ClampedArray(UPNG.toRGBA8(data)[0]),
        width: data.width,
        height: data.height,
      };
  }

Created by

logo GammaStream

GAMMASTREAM

Keywords

FAQs

Last updated on 21 Feb 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc