diff options
| author | Rose Hogenson <rosehogenson@posteo.net> | 2026-05-28 11:04:00 -0700 |
|---|---|---|
| committer | Rose Hogenson <rosehogenson@posteo.net> | 2026-05-28 11:04:00 -0700 |
| commit | 9bf6dbe233bfb73fbdd762fee3896a7ea60ad961 (patch) | |
| tree | 4995089c8a52313c607a9aa906c2fe73ea9ef066 | |
| parent | 1c80f17324220f6827e5fed95ea2220b61019853 (diff) | |
| download | imgutil-9bf6dbe233bfb73fbdd762fee3896a7ea60ad961.tar.zst | |
Handle large values for -x
| -rw-r--r-- | thumbnailer.go | 3 |
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 { |
