Skip to content

Commit

Permalink
Use base64 assets instead of one over github (#235)
Browse files Browse the repository at this point in the history
  • Loading branch information
mebjas authored Jun 14, 2021
1 parent 9af2e1d commit 73d4922
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 13 deletions.
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### Version 2.0.10
- Migrate from assets hosted on Github to embedded base64 assets.

### Version 2.0.9
- Added support for returning the type of code scanned (
[feature request](https://github.com/mebjas/html5-qrcode/issues/224))
Expand Down
2 changes: 1 addition & 1 deletion dist/html5-qrcode.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "html5-qrcode",
"version": "2.0.9",
"version": "2.0.10",
"description": "A cross platform HTML5 QR Code & bar code scanner",
"main": "dist/html5-qrcode.min.js",
"scripts": {
Expand Down
8 changes: 0 additions & 8 deletions src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,8 @@ export enum Html5QrcodeScanType {
* Constants used in QR code library.
*/
export class Html5QrcodeConstants {
static ASSET_FILE_SCAN: string
= "https://raw.githubusercontent.com/mebjas/html5-qrcode/master/assets"
+ "/file-scan.gif";
static ASSET_CAMERA_SCAN: string
= "https://raw.githubusercontent.com/mebjas/html5-qrcode/master/assets"
+ "/camera-scan.gif";

static GITHUB_PROJECT_URL: string
= "https://github.com/mebjas/html5-qrcode";

static SCAN_DEFAULT_FPS = 2;
static DEFAULT_DISABLE_FLIP = false;
}
Expand Down
10 changes: 7 additions & 3 deletions src/html5-qrcode-scanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {
Html5QrcodeResult,
Html5QrcodeError,
Html5QrcodeErrorFactory,
Html5QrcodeResultFactory,
CameraDevice,
BaseLoggger,
Logger,
Expand All @@ -33,6 +32,11 @@ import {
Html5QrcodeScannerStrings,
} from "./strings";

import {
ASSET_FILE_SCAN,
ASSET_CAMERA_SCAN
} from "./image-assets";

/**
* Different states of QR Code Scanner.
*/
Expand Down Expand Up @@ -635,7 +639,7 @@ export class Html5QrcodeScanner {
}
this.cameraScanImage.width = 64;
this.cameraScanImage.style.opacity = "0.3";
this.cameraScanImage.src = Html5QrcodeConstants.ASSET_CAMERA_SCAN;
this.cameraScanImage.src = ASSET_CAMERA_SCAN;
}

private insertFileScanImageToScanRegion() {
Expand All @@ -656,7 +660,7 @@ export class Html5QrcodeScanner {
}
this.fileScanImage.width = 64;
this.fileScanImage.style.opacity = "0.3";
this.fileScanImage.src = Html5QrcodeConstants.ASSET_FILE_SCAN;
this.fileScanImage.src = ASSET_FILE_SCAN;
}

private clearScanRegion() {
Expand Down
12 changes: 12 additions & 0 deletions src/image-assets.ts

Large diffs are not rendered by default.

0 comments on commit 73d4922

Please sign in to comment.