aboutsummaryrefslogtreecommitdiffstats
path: root/thumbnailer.go
diff options
context:
space:
mode:
authorRose Hogenson <rosehogenson@posteo.net>2026-05-28 11:04:00 -0700
committerRose Hogenson <rosehogenson@posteo.net>2026-05-28 11:04:00 -0700
commit9bf6dbe233bfb73fbdd762fee3896a7ea60ad961 (patch)
tree4995089c8a52313c607a9aa906c2fe73ea9ef066 /thumbnailer.go
parentMake sixel the default (diff)
downloadimgutil-9bf6dbe233bfb73fbdd762fee3896a7ea60ad961.tar.zst
Handle large values for -x
Diffstat (limited to 'thumbnailer.go')
-rw-r--r--thumbnailer.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/thumbnailer.go b/thumbnailer.go
index 07fdc37..89f9fed 100644
--- a/thumbnailer.go
+++ b/thumbnailer.go
@@ -431,7 +431,8 @@ func thumbnailer(args []string) error {
termCols := int(ws.Col)
cellX, cellY := int(ws.Xpixel)/int(ws.Col), int(ws.Ypixel)/int(ws.Row)
- imagesPerRow := termCols / (cols + 1)
+ cols = min(cols, termCols)
+ imagesPerRow := (termCols + 1) / (cols + 1)
var files, dirs []string
if len(args) == 0 {