Skip to content

Commit b63cd52

Browse files
added 11.9.1
1 parent b2ace17 commit b63cd52

File tree

5 files changed

+26
-24
lines changed

5 files changed

+26
-24
lines changed

README.md

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Acuant JavaScript Web SDK v11.9.0
1+
# Acuant JavaScript Web SDK v11.9.1
22

33
**July 2023**
44

@@ -191,7 +191,7 @@ The SDK includes the following modules:
191191
PREVIEW: https://preview.acas.acuant.net
192192
```
193193

194-
1. After *initialize* or *initializeWithToken* succeeds, start the Web Workers. By default, the function *start* starts all the Workers. Alternatively, you can provide a boolean to enable the single worker model. The single worker model will only start one worker at a time and is intened for low-end devices which struggle to run both workers at the same time. Be aware that this model might degrade the overall performance.
194+
1. After the *initialize* or *initializeWithToken* function succeeds, start the Web Workers. By default, the *start* function starts all the Workers. Alternatively, you can provide a boolean to enable the single worker model. The single worker model starts only one worker at a time and is intended for low-end devices that struggle to run both workers at the same time. Note that this model might degrade the overall performance.
195195

196196
```js
197197
AcuantJavascriptWebSdk.start(
@@ -797,14 +797,7 @@ See the [WebView ReadMe](docs/WebViewReadMe.md) for documentation on WebViews.
797797
798798
## Improved support for devices with extreme memory constraints
799799
800-
Although the Web Workers use only a minimal amount of memory, you can reduce the memory usage by running only one of the Web Workers at a time. This is recommended only if you have severe memory constraints that you can not address any other way. Normally when both **AcauntImageWorker** and **AcuantMetricsWorker** are running simultaneously, they seamlessly make calls between themselves until they are ready to return a finished image that has been cropped and has had all the metrics run on it. If only one is running at a time, the workflow has to look like this:
801-
802-
- AcuantImageWorker is started to perform detect in your custom camera implementation
803-
- AcuantImageWorker is ended and AcuantMetricsWorker is started to perform moire on the uncropped image
804-
- AcuantMetricsWorker is ended and AcuantImageWorker is started to crop the image
805-
- AcuantImageWorker is ended and AcuantMetricsWorker is started to perform the remaining metrics on the cropped image
806-
807-
Starting and stopping Workers is a very slow operation, so you will see performance losses with this approach. Therefore, use this approach only if absolutely necessary. See [Reference of AcuantJavascriptWebSdk methods](#reference-of-acuantjavascriptwebsdk-methods) for more information about the methods.
800+
See the single worker model in [Initialize and Start the SDK](#initialize-and-start-the-sdk).
808801
809802
----------
810803

webSdk/AcuantCamera.js

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,7 @@ var AcuantCamera = (() => {
498498
let isDetecting = false;
499499
let detectTimeout = null;
500500
let acuantCamera;
501+
let modelFromHighEntropyValues;
501502

502503
let svc = {
503504
start: start,
@@ -541,14 +542,12 @@ var AcuantCamera = (() => {
541542
return ((/iPad|iPhone|iPod/.test(navigator.platform) && checkIOSVersion()) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1));
542543
}
543544

544-
function isSamsungNote10OrS10OrNewer(dm) {
545-
let deviceModel = navigator.userAgent;
546-
if (dm) {
547-
if (typeof(dm) === 'string') {
548-
deviceModel = dm;
549-
} else if (typeof(dm.model) === 'string') {
550-
deviceModel = dm.model;
551-
}
545+
function isSamsungNote10OrS10OrNewer() {
546+
let deviceModel;
547+
if (modelFromHighEntropyValues) {
548+
deviceModel = modelFromHighEntropyValues;
549+
} else {
550+
deviceModel = navigator.userAgent;
552551
}
553552

554553
const matchedModelNumber = deviceModel.match(/SM-[N|G|S]\d{3}/);
@@ -790,16 +789,26 @@ var AcuantCamera = (() => {
790789

791790
function setZoomConstraintThenStartCamera() {
792791
if (navigator.userAgentData && navigator.userAgentData.getHighEntropyValues) {
793-
navigator.userAgentData.getHighEntropyValues(['model']).then(deviceModel => {
794-
if (isSamsungNote10OrS10OrNewer(deviceModel)) {
792+
navigator.userAgentData.getHighEntropyValues(['model']).then(dm => {
793+
if (typeof(dm) === 'string') {
794+
modelFromHighEntropyValues = dm;
795+
} else if (typeof(dm.model) === 'string') {
796+
modelFromHighEntropyValues = dm.model;
797+
}
798+
}).finally(() => {
799+
if (isSamsungNote10OrS10OrNewer()) {
795800
//We found out that some triple camera Samsung devices (S10, S20, Note 20, etc) capture images blurry at edges.
796801
//Zooming to 2X, matching the telephoto lens, doesn't solve it completely but mitigates it.
797802
userConfig.primaryConstraints.video.zoom = 2.0;
798803
}
799-
}).finally(() => {
800804
startCamera(userConfig.primaryConstraints);
801805
});
802806
} else {
807+
if (isSamsungNote10OrS10OrNewer()) {
808+
//We found out that some triple camera Samsung devices (S10, S20, Note 20, etc) capture images blurry at edges.
809+
//Zooming to 2X, matching the telephoto lens, doesn't solve it completely but mitigates it.
810+
userConfig.primaryConstraints.video.zoom = 2.0;
811+
}
803812
startCamera(userConfig.primaryConstraints);
804813
}
805814
}

0 commit comments

Comments
 (0)