[SCM] Multi-format 1D/2D barcode image processing library branch, upstream, updated. 24d4480bc48cf9eabf7b2bd2f528248b0e458809
srowen
srowen at 59b500cc-1b3d-0410-9834-0bbf25fbcc57
Wed Aug 4 01:30:53 UTC 2010
The following commit has been merged in the upstream branch:
commit 9d79d39a7f40069c21804bdfc36786607979a07a
Author: srowen <srowen at 59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Date: Wed Apr 7 08:10:35 2010 +0000
Look for mot-zoom-step
git-svn-id: http://zxing.googlecode.com/svn/trunk@1290 59b500cc-1b3d-0410-9834-0bbf25fbcc57
diff --git a/android/src/com/google/zxing/client/android/CameraManager.java b/android/src/com/google/zxing/client/android/CameraManager.java
index 5d7f598..c18fc6d 100755
--- a/android/src/com/google/zxing/client/android/CameraManager.java
+++ b/android/src/com/google/zxing/client/android/CameraManager.java
@@ -476,14 +476,27 @@ final class CameraManager {
}
}
- String motZoomValues = parameters.get("mot-zoom-values");
- if (motZoomValues != null) {
- tenDesiredZoom = findBestMotZoomValue(motZoomValues, tenDesiredZoom);
+ String motZoomValuesString = parameters.get("mot-zoom-values");
+ if (motZoomValuesString != null) {
+ tenDesiredZoom = findBestMotZoomValue(motZoomValuesString, tenDesiredZoom);
+ }
+
+ String motZoomStepString = parameters.get("mot-zoom-step");
+ if (motZoomStepString != null) {
+ try {
+ double motZoomStep = Double.parseDouble(motZoomStepString.trim());
+ int tenZoomStep = (int) (10.0 * motZoomStep);
+ if (tenZoomStep > 1) {
+ tenDesiredZoom -= tenDesiredZoom % tenZoomStep;
+ }
+ } catch (NumberFormatException nfe) {
+ // continue
+ }
}
// Set zoom. This helps encourage the user to pull back.
// Some devices like the Behold have a zoom parameter
- if (maxZoomString != null || motZoomValues != null) {
+ if (maxZoomString != null || motZoomValuesString != null) {
parameters.set("zoom", String.valueOf(tenDesiredZoom / 10.0));
}
--
Multi-format 1D/2D barcode image processing library
More information about the Pkg-google-commits
mailing list