From efa68afca1a2492a14686623c8e5b653e9e8e7ac Mon Sep 17 00:00:00 2001 From: Haroka-74 Date: Tue, 28 Apr 2026 11:56:56 +0300 Subject: [PATCH] fix(view): prevent division by zero panic in imageRows --- view/html.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/view/html.go b/view/html.go index ba3846e6..f83b31dd 100644 --- a/view/html.go +++ b/view/html.go @@ -509,6 +509,9 @@ func imageRows(payload string) int { if data, err := base64.StdEncoding.DecodeString(payload); err == nil { if _, h, ok := clib.ImageDimensions(data); ok { cellHeight := getTerminalCellSize() + if cellHeight == 0 { + cellHeight = 16 + } rows = (h + cellHeight - 1) / cellHeight if rows < 1 { rows = 1