fix: align camera payload caps

This commit is contained in:
Peter Steinberger
2025-12-29 23:20:35 +01:00
parent 6e83f95c83
commit 6927b0fb8d
7 changed files with 17 additions and 3 deletions

View File

@@ -101,6 +101,7 @@ class CameraCaptureManager(private val context: Context) {
}
val maxPayloadBytes = 5 * 1024 * 1024
// Base64 inflates payloads by ~4/3; cap encoded bytes so the payload stays under 5MB (API limit).
val maxEncodedBytes = (maxPayloadBytes / 4) * 3
val result =
JpegSizeLimiter.compressToLimit(

View File

@@ -67,6 +67,7 @@ fun RootScreen(viewModel: MainViewModel) {
val cameraFlashToken by viewModel.cameraFlashToken.collectAsState()
val activity =
remember(cameraHud) {
// Status pill owns transient capture state so it doesn't overlap the connection indicator.
cameraHud?.let { hud ->
when (hud.kind) {
CameraHudKind.Photo ->