Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,8 @@ class BarcodeScannerActivity : AppCompatActivity(), BarcodeScannerFrameHandler.R

fun processPictureTaken(image: ImageRef, imageOrientation: Int) {
image.toBitmap().onSuccess { bitmap ->
val matrix = Matrix()
matrix.setRotate(imageOrientation.toFloat(), bitmap.width / 2f, bitmap.height / 2f)
val resultBitmap =
Bitmap.createBitmap(bitmap, 0, 0, bitmap.width, bitmap.height, matrix, false)

resultView.post {
resultView.setImageBitmap(resultBitmap)
resultView.setImageBitmap(bitmap)
cameraView.continuousFocus()
cameraView.startPreview()
}
Expand Down
2 changes: 1 addition & 1 deletion classic-components-example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ allprojects {

jvmToolchainVersion = 17

scanbotSdkVersion = "8.0.0"
scanbotSdkVersion = "8.0.1.80-STAGING-SNAPSHOT"

androidCoreKtxVersion = "1.6.0"
constraintLayoutVersion = "2.0.4"
Expand Down
2 changes: 1 addition & 1 deletion data-capture-ready-to-use-ui-example/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version")

def scanbotSdkVersion = "8.0.0"
def scanbotSdkVersion = "8.0.1.80-STAGING-SNAPSHOT"

implementation("io.scanbot:sdk-package-4:$scanbotSdkVersion")
implementation("io.scanbot:rtu-ui-v2-bundle:$scanbotSdkVersion")
Expand Down
2 changes: 1 addition & 1 deletion document-scanner-ready-to-use-ui-example/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ android {
}
}

def scanbotSdkVersion = "8.0.0"
def scanbotSdkVersion = "8.0.1.80-STAGING-SNAPSHOT"

dependencies {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,22 +247,12 @@ fun handlingCameraPictureSnippet(cameraView: ScanbotCameraXView, context: Contex
}
}

// Decode image byte array to Bitmap, and rotate according to orientation:
val image =
ImageProcessor(imageRef).rotate(captureInfo.imageOrientation).processedImageRef()

if (image == null) {
// license or feature is not available
restartCamera()
return
}

// Run document contour detection on original image:
val scanningResult = scanner.run(image).getOrNull()
val scanningResult = scanner.run(imageRef).getOrNull()
val documentPolygon = scanningResult?.pointsNormalized
if (documentPolygon != null) {
// And crop using detected polygon to get the final document image:
val documentImage = ImageProcessor(image).crop(documentPolygon).processedBitmap()
val documentImage = ImageProcessor(imageRef).crop(documentPolygon).processedBitmap()

// Work with the final document image (store it as a file, etc)
// ...
Expand Down