Skip to content

v4.6.0

Compare
Choose a tag to compare
@k3vink3vin k3vink3vin released this 22 Apr 11:22
· 15 commits to master since this release
1c07702

Features

  • ScanThng.convertToDataUrl: Provides functionality to read a user file into a data URL.

  • ScanThng.convertImageFormat: Pre-processs an image for QR decoding.

<input
  id="file"
  name="file"
  type="file"
  onChange={async event => {
    const file = event.currentTarget.files[0];
    const dataUrl = await ScanThng.convertToDataUrl(file);
    const processedDataUrl = await ScanThng.convertImageFormat(
      dataUrl,
      {
        imageConversion: {
          exportFormat: 'image/jpeg',
          exportQuality: 0.9,
          greyscale: false,
          resizeTo: 480,
        },
      },
    );
    console.log(processedDataUrl);
  }}
/>