aboutsummaryrefslogtreecommitdiffstats
path: root/thumbnailer.go
diff options
context:
space:
mode:
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 {