Socket
Socket
Sign inDemoInstall

vue-qrcode-reader

Package Overview
Dependencies
Maintainers
1
Versions
135
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-qrcode-reader - npm Package Compare versions

Comparing version 0.8.2 to 0.8.3

.npmignore

4

package.json
{
"name": "vue-qrcode-reader",
"description": "A Vue.js component, accessing the device camera and allowing users to read QR-Codes, within the browser",
"version": "0.8.2",
"version": "0.8.3",
"author": {

@@ -87,4 +87,4 @@ "name": "Niklas Gruhn",

"lodash": "^4.17.4",
"webrtc-adapter": "^6.0.2"
"webrtc-adapter": "^6.2.1"
}
}

@@ -77,5 +77,5 @@ # vue-qrcode-reader

By default detected QR codes are visually highlighted. A transparent canvas overlays the camera stream. When a QR code is detected, its location is painted to the canvas. You can enable/disable this feature by passing `true`/`false` via the `track` prop.
By default detected QR codes are visually highlighted. A transparent canvas overlays the camera stream. When a QR code is detected, its location is painted to the canvas. You can enable/disable this feature by passing `true`/`false` via the `track` prop. If tracking is disabled the camera stream is scanned much less frequently. So if you encounter performance problems on your target device, this might help.
You can also pass a function to customize the way the location is painted. This function is called to produce each frame. It receives the location object as the first argument and a `CanvasRenderingContext2D` instance as the second argument.
You can also pass a function with `track` to customize the way the location is painted. This function is called to produce each frame. It receives the location object as the first argument and a `CanvasRenderingContext2D` instance as the second argument.

@@ -103,3 +103,3 @@ :point_right: Avoid access to reactive properties in this function (like stuff in `data`, `computed` or your Vuex store). The function is called several times a second and might cause memory leaks. If you want to be save don't access `this` at all.

ctx.beginPath()
ctx.moveTo(topLeftCorner.x, topRightCorner.y)
ctx.moveTo(topLeftCorner.x, topLeftCorner.y)
ctx.lineTo(bottomLeftCorner.x, bottomLeftCorner.y)

@@ -158,4 +158,5 @@ ctx.lineTo(bottomRightCorner.x, bottomRightCorner.y)

facingMode: { ideal: 'environment' }, // use rear camera if available
width: { min: 360, ideal: 1280, max: 1920 }, // constrain video width resolution
height: { min: 240, ideal: 720, max: 1080 } // constrain video height resolution
width: { min: 360, ideal: 680, max: 1920 }, // constrain video width resolution
height: { min: 240, ideal: 480, max: 1080 }, // constrain video height resolution
frameRate: { min: 10, ideal: 25 }
}

@@ -162,0 +163,0 @@ }

@@ -30,24 +30,31 @@ import 'webrtc-adapter'

shouldContinue,
scanInterval = 16, // milliseconds
minDelay,
} = options
const recur = (contentBefore, locationBefore) => {
return () => {
const imageData = camera.captureFrame()
const { content, location } = scan(imageData)
let contentBefore = null
let locationBefore = null
let lastScanned = performance.now()
if (content !== null && content !== contentBefore) {
decodeHandler(content)
}
const processFrame = () => {
if (shouldContinue()) {
window.requestAnimationFrame(processFrame)
if (location !== locationBefore) {
locateHandler(location)
}
const timeNow = performance.now()
if (shouldContinue()) {
window.setTimeout(() => {
window.requestAnimationFrame(
recur(content || contentBefore, location)
)
}, scanInterval)
if (timeNow - lastScanned >= minDelay) {
lastScanned = timeNow
const imageData = camera.captureFrame()
const { content, location } = scan(imageData)
if (content !== null && content !== contentBefore) {
decodeHandler(content)
}
if (location !== locationBefore) {
locateHandler(location)
}
contentBefore = content || contentBefore
locationBefore = location
}

@@ -57,3 +64,3 @@ }

window.requestAnimationFrame(recur(null, null))
processFrame()
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc