Skip to content

Commit d95edc1

Browse files
authored
Merge pull request #405 from doo/android_ds_7.0.2
acceptance 7.0.2
2 parents e3f44d0 + cca577f commit d95edc1

File tree

8 files changed

+47
-19
lines changed

8 files changed

+47
-19
lines changed

Libraries.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Open Source libraries used in the Scanbot SDK for Android version 7.0.0
1+
Open Source libraries used in the Scanbot SDK for Android version 7.0.2
22

33
CWAC-Camera
44

@@ -171,7 +171,7 @@ limitations under the License.
171171

172172
Boost C++
173173

174-
Version 1.79.0
174+
Version 1.88.0
175175
(https://github.com/boostorg/boost)
176176

177177
Boost Software License - Version 1.0 - August 17th, 2003
@@ -2144,7 +2144,7 @@ Version 1.1.0h
21442144

21452145
spdlog
21462146

2147-
Version v1.14.1
2147+
Version v1.15.2
21482148
(https://github.com/gabime/spdlog)
21492149

21502150
The MIT License (MIT)
@@ -2689,7 +2689,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26892689

26902690
xsimd
26912691

2692-
Version 13.0.0
2692+
Version 13.2.0
26932693
(https://github.com/xtensor-stack/xsimd)
26942694

26952695
Copyright (c) 2016, Johan Mabille, Sylvain Corlay, Wolf Vollprecht and Martin Renou
@@ -2727,7 +2727,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27272727

27282728
xtensor
27292729

2730-
Version 0.25.0
2730+
Version 0.26.0-scanbot
27312731
(https://github.com/doo/xtensor)
27322732

27332733
Copyright (c) 2016, Johan Mabille, Sylvain Corlay and Wolf Vollprecht
@@ -2764,7 +2764,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27642764

27652765
xtl
27662766

2767-
Version 0.7.7
2767+
Version 0.8.0
27682768
(https://github.com/xtensor-stack/xtl)
27692769

27702770
BSD 3-Clause License

classic-components-example/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ allprojects {
1515

1616
jvmToolchainVersion = 17
1717

18-
scanbotSdkVersion = "7.0.0"
18+
scanbotSdkVersion = "7.0.2.1106-SNAPSHOT"
1919

2020
androidCoreKtxVersion = "1.6.0"
2121
constraintLayoutVersion = "2.0.4"

classic-components-example/mrz-scanner/src/main/java/io/scanbot/example/MRZLiveScanningActivity.kt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class MRZLiveScanningActivity : AppCompatActivity() {
2626
// @Tag("Mrz Classic Camera")
2727
private lateinit var cameraView: ScanbotCameraXView
2828
private lateinit var finderOverlay: FinderOverlayView
29-
29+
private lateinit var mrzScannerFrameHandler : MrzScannerFrameHandler
3030
private var flashEnabled = false
3131

3232
override fun onCreate(savedInstanceState: Bundle?) {
@@ -54,7 +54,7 @@ class MRZLiveScanningActivity : AppCompatActivity() {
5454
// Configure mrz scanner
5555
val mrzScanner = scanbotSDK.createMrzScanner()
5656
// Attach mrz scanner to the camera
57-
val mrzScannerFrameHandler = MrzScannerFrameHandler.attach(cameraView, mrzScanner)
57+
mrzScannerFrameHandler = MrzScannerFrameHandler.attach(cameraView, mrzScanner)
5858
// Handle live mrz scanning results
5959
mrzScannerFrameHandler.addResultHandler { result ->
6060
if (result is FrameHandlerResult.Success) {
@@ -66,6 +66,7 @@ class MRZLiveScanningActivity : AppCompatActivity() {
6666
if (scannerResult.success
6767
&& mrzDocument?.checkDigitGeneral?.isValid == true
6868
) {
69+
mrzScannerFrameHandler.isEnabled = false
6970
startActivity(MRZResultActivity.newIntent(this, scannerResult))
7071
}
7172
}
@@ -82,6 +83,12 @@ class MRZLiveScanningActivity : AppCompatActivity() {
8283
Toast.LENGTH_LONG
8384
).show()
8485
}
86+
87+
override fun onResume() {
88+
super.onResume()
89+
mrzScannerFrameHandler.isEnabled = true
90+
}
91+
8592
// @EndTag("Mrz Classic Camera")
8693
private fun askPermission() {
8794
if (ContextCompat.checkSelfPermission(

data-capture-ready-to-use-ui-example/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ dependencies {
7474
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version")
7575
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version")
7676

77-
def scanbotSdkVersion = "7.0.0"
77+
def scanbotSdkVersion = "7.0.2.1106-SNAPSHOT"
7878

7979
implementation("io.scanbot:sdk-package-4:$scanbotSdkVersion")
8080
implementation("io.scanbot:sdk-package-ui:$scanbotSdkVersion")

document-scanner-ready-to-use-ui-example/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ android {
3939
}
4040
}
4141

42-
def scanbotSdkVersion = "7.0.0"
42+
def scanbotSdkVersion = "7.0.2.1106-SNAPSHOT"
4343

4444
dependencies {
4545

document-scanner-ready-to-use-ui-example/app/src/main/java/com/example/scanbot/doc_code_snippet/TiffFromDocumentSnippet.kt

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class TiffFromDocumentSnippet : AppCompatActivity() {
5252
}
5353
document.addPage(bitmap)
5454
}
55-
createTiffFromImages(document)
55+
createTiffFromDocument(document)
5656
}
5757
}
5858
}
@@ -63,11 +63,10 @@ class TiffFromDocumentSnippet : AppCompatActivity() {
6363
// Create tiff generator instance
6464
val tiffGenerator = scanbotSDK.createTiffGenerator()
6565

66-
fun createTiffFromImages(document: Document) {
66+
fun createTiffFromDocument(document: Document) {
6767
val config = TiffGeneratorParameters(
68-
binarizationFilter = ScanbotBinarizationFilter(),
6968
dpi = 200,
70-
compression = CompressionMode.NONE,
69+
compression = TiffGeneratorParameters.defaultCompression, // default compression is `CompressionMode.LZW`
7170
userFields = arrayListOf()
7271
)
7372
val tiffFile = document.tiffUri.toFile()
@@ -85,6 +84,29 @@ class TiffFromDocumentSnippet : AppCompatActivity() {
8584
}
8685
// @EndTag("Creating a TIFF from a Document")
8786

87+
// @Tag("Creating a binarized TIFF from a Document")
88+
fun createBinarizedTiffFromDocument(document: Document) {
89+
val config = TiffGeneratorParameters(
90+
binarizationFilter = ScanbotBinarizationFilter(),
91+
dpi = 200,
92+
compression = TiffGeneratorParameters.binaryDocumentOptimizedCompression, // compression is `CompressionMode.CCITT_T6`
93+
userFields = arrayListOf()
94+
)
95+
val tiffFile = document.tiffUri.toFile()
96+
val tiffGenerated = tiffGenerator.generateFromDocument(
97+
document,
98+
tiffFile,
99+
config
100+
)
101+
val file = tiffFile
102+
if (tiffGenerated && file.exists()) {
103+
// Do something with the Tiff file
104+
} else {
105+
Log.e("TiffFromDocumentSnippet", "Failed to create Tiff")
106+
}
107+
}
108+
// @EndTag("Creating a binarized TIFF from a Document")
109+
88110

89111
private fun importImagesFromLibrary() {
90112
val imageIntent = Intent()

document-scanner-ready-to-use-ui-example/app/src/main/java/com/example/scanbot/doc_code_snippet/TiffFromImageSnippet.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,8 @@ class TiffFromImageSnippet : AppCompatActivity() {
5252
fun createTiffFromImages(list: List<Uri>) {
5353
// Create the default Tiff generation options.
5454
val config = TiffGeneratorParameters(
55-
binarizationFilter = ScanbotBinarizationFilter(),
5655
dpi = 200,
57-
compression = CompressionMode.NONE,
56+
compression = TiffGeneratorParameters.defaultCompression, // Use default compression (LZW)
5857
userFields = arrayListOf()
5958
)
6059
// notify the generator that the images are encrypted with global sdk-encryption settings

document-scanner-ready-to-use-ui-example/app/src/main/java/com/example/scanbot/doc_code_snippet/rtu_ui/ComposeSnippet.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ package com.example.scanbot.doc_code_snippet.rtu_ui
44
import android.os.Bundle
55
import androidx.appcompat.app.AppCompatActivity
66
import androidx.compose.ui.platform.ComposeView
7-
// @Tag("Single Page With Finder Overlay")
7+
// @Tag("Jetpack Compose: Single Page With Finder Overlay")
88
import io.scanbot.sdk.common.AspectRatio
99
import io.scanbot.sdk.ui_v2.common.FinderStyle
1010
import io.scanbot.sdk.ui_v2.common.ScanbotColor
@@ -70,5 +70,5 @@ class ComposeSnippet : AppCompatActivity() {
7070
}
7171
}
7272
}
73-
// @EndPage("Single Page With Finder Overlay")
73+
// @EndPage("Jetpack Compose: Single Page With Finder Overlay")
7474

0 commit comments

Comments
 (0)