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}") } } }