File tree Expand file tree Collapse file tree
app/src/main/java/com/vandam/zero Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -375,20 +375,22 @@ class CameraViewModel : ViewModel() {
375375 _shutterFlash .value = true
376376 },
377377 onPreviewReady = { bitmap ->
378- if (bitmap != null ) {
378+ if (bitmap != null && _previewEnabled .value ) {
379379 _capturedImageIsPortrait .value = bitmap.height > bitmap.width
380380 _capturedImageBitmap .value = bitmap
381- if ( _outputFormat .value != 2 ) {
382- _isSaving .value = false
383- }
381+ }
382+ if ( _outputFormat .value != 2 ) {
383+ _isSaving .value = false
384384 }
385385 },
386386 onComplete = { uri ->
387387 if (uri != null && _outputFormat .value == 2 ) {
388- val thumbnail = extractDngThumbnail(uri)
389- if (thumbnail != null ) {
390- _capturedImageIsPortrait .value = thumbnail.height > thumbnail.width
391- _capturedImageBitmap .value = thumbnail
388+ if (_previewEnabled .value) {
389+ val thumbnail = extractDngThumbnail(uri)
390+ if (thumbnail != null ) {
391+ _capturedImageIsPortrait .value = thumbnail.height > thumbnail.width
392+ _capturedImageBitmap .value = thumbnail
393+ }
392394 }
393395 _isSaving .value = false
394396 }
You can’t perform that action at this time.
0 commit comments