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 <noreply@anthropic.com>
This commit is contained in:
parent
6ed3e8e7b5
commit
ef350e9fb7
1 changed files with 6 additions and 1 deletions
|
|
@ -11,6 +11,7 @@ import android.net.Uri
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.os.Environment
|
import android.os.Environment
|
||||||
import android.provider.MediaStore
|
import android.provider.MediaStore
|
||||||
|
import android.util.Log
|
||||||
import androidx.exifinterface.media.ExifInterface
|
import androidx.exifinterface.media.ExifInterface
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.withContext
|
import kotlinx.coroutines.withContext
|
||||||
|
|
@ -33,6 +34,10 @@ sealed class SaveResult {
|
||||||
*/
|
*/
|
||||||
class PhotoSaver(private val context: Context) {
|
class PhotoSaver(private val context: Context) {
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
private const val TAG = "PhotoSaver"
|
||||||
|
}
|
||||||
|
|
||||||
private val exifWriter = ExifWriter()
|
private val exifWriter = ExifWriter()
|
||||||
|
|
||||||
private val fileNameFormat = SimpleDateFormat("yyyyMMdd_HHmmss", Locale.US)
|
private val fileNameFormat = SimpleDateFormat("yyyyMMdd_HHmmss", Locale.US)
|
||||||
|
|
@ -169,7 +174,7 @@ class PhotoSaver(private val context: Context) {
|
||||||
exif.saveAttributes()
|
exif.saveAttributes()
|
||||||
}
|
}
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
e.printStackTrace()
|
Log.w(TAG, "Failed to write EXIF data", e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue