Add decode failure logging to DenseThumb to diagnose sparse thumbnails
This commit is contained in:
@@ -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}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user