From ef350e9fb7413add3883cb15102ae8080ccb5989 Mon Sep 17 00:00:00 2001 From: Ole-Morten Duesund Date: Fri, 27 Feb 2026 15:22:04 +0100 Subject: [PATCH] Replace e.printStackTrace() with Log.w in PhotoSaver EXIF write failures are non-critical (the photo is already saved) but should still be visible in logcat. Use Log.w with a proper TAG instead of printStackTrace(). Co-Authored-By: Claude Opus 4.6 --- app/src/main/java/no/naiv/tiltshift/storage/PhotoSaver.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/no/naiv/tiltshift/storage/PhotoSaver.kt b/app/src/main/java/no/naiv/tiltshift/storage/PhotoSaver.kt index 968ef55..74ec8ea 100644 --- a/app/src/main/java/no/naiv/tiltshift/storage/PhotoSaver.kt +++ b/app/src/main/java/no/naiv/tiltshift/storage/PhotoSaver.kt @@ -11,6 +11,7 @@ import android.net.Uri import android.os.Build import android.os.Environment import android.provider.MediaStore +import android.util.Log import androidx.exifinterface.media.ExifInterface import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext @@ -33,6 +34,10 @@ sealed class SaveResult { */ class PhotoSaver(private val context: Context) { + companion object { + private const val TAG = "PhotoSaver" + } + private val exifWriter = ExifWriter() private val fileNameFormat = SimpleDateFormat("yyyyMMdd_HHmmss", Locale.US) @@ -169,7 +174,7 @@ class PhotoSaver(private val context: Context) { exif.saveAttributes() } } catch (e: Exception) { - e.printStackTrace() + Log.w(TAG, "Failed to write EXIF data", e) } }