From fbd228b768d1516beba98d04c4e2f95f3bf1430a Mon Sep 17 00:00:00 2001 From: Kyle Bolen Date: Thu, 30 Jul 2026 03:30:47 +0000 Subject: [PATCH] Add decode failure logging to DenseThumb to diagnose sparse thumbnails --- .../kotlin/com/bolenpad/photophetch/ui/DensePhotoGrid.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/com/bolenpad/photophetch/ui/DensePhotoGrid.kt b/src/main/kotlin/com/bolenpad/photophetch/ui/DensePhotoGrid.kt index 52b70b3..413061d 100644 --- a/src/main/kotlin/com/bolenpad/photophetch/ui/DensePhotoGrid.kt +++ b/src/main/kotlin/com/bolenpad/photophetch/ui/DensePhotoGrid.kt @@ -31,6 +31,8 @@ import java.time.LocalDate import java.time.ZoneId import java.time.format.DateTimeFormatter +private val thumbLog = org.slf4j.LoggerFactory.getLogger("DenseThumb") + /** * Dense grid: folder headers + flat photo grid per folder. * Each photo that is the first of its day gets a small date label @@ -182,9 +184,11 @@ private fun DenseThumb( pullFn = pullFn, ) } - if (bytes != null) { + if (bytes != null && bytes.isNotEmpty()) { runCatching { thumbnail = SkiaImage.makeFromEncoded(bytes).toComposeImageBitmap() + }.onFailure { e -> + thumbLog.warn("Decode failed for ${photo.filename} (${bytes.size} bytes): ${e.message}") } } }