Add decode failure logging to DenseThumb to diagnose sparse thumbnails

This commit is contained in:
Kyle Bolen
2026-07-30 03:30:47 +00:00
parent 309031aed7
commit fbd228b768

View File

@@ -31,6 +31,8 @@ import java.time.LocalDate
import java.time.ZoneId import java.time.ZoneId
import java.time.format.DateTimeFormatter import java.time.format.DateTimeFormatter
private val thumbLog = org.slf4j.LoggerFactory.getLogger("DenseThumb")
/** /**
* Dense grid: folder headers + flat photo grid per folder. * Dense grid: folder headers + flat photo grid per folder.
* Each photo that is the first of its day gets a small date label * Each photo that is the first of its day gets a small date label
@@ -182,9 +184,11 @@ private fun DenseThumb(
pullFn = pullFn, pullFn = pullFn,
) )
} }
if (bytes != null) { if (bytes != null && bytes.isNotEmpty()) {
runCatching { runCatching {
thumbnail = SkiaImage.makeFromEncoded(bytes).toComposeImageBitmap() thumbnail = SkiaImage.makeFromEncoded(bytes).toComposeImageBitmap()
}.onFailure { e ->
thumbLog.warn("Decode failed for ${photo.filename} (${bytes.size} bytes): ${e.message}")
} }
} }
} }