From 74772863b8351f7daa09a39d094aa69ee4bc814b Mon Sep 17 00:00:00 2001 From: mjip Date: Mon, 29 Aug 2022 00:19:24 -0400 Subject: [PATCH] Log terminal size determination error instead of nil --- convert/resize.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/convert/resize.go b/convert/resize.go index 30bd303..cf0a78a 100644 --- a/convert/resize.go +++ b/convert/resize.go @@ -1,10 +1,11 @@ package convert import ( - "github.com/nfnt/resize" - "github.com/qeesung/image2ascii/terminal" "image" "log" + + "github.com/nfnt/resize" + "github.com/qeesung/image2ascii/terminal" ) // NewResizeHandler create a new resize handler @@ -126,7 +127,7 @@ func (handler *ImageResizeHandler) resolveSize(sz image.Rectangle, options *Opti func (handler *ImageResizeHandler) CalcProportionalFittingScreenSize(sz image.Rectangle) (newWidth, newHeight int, err error) { screenWidth, screenHeight, err := handler.terminal.ScreenSize() if err != nil { - log.Fatal(nil) + log.Fatal(err) } newWidth, newHeight = handler.CalcFitSize( float64(screenWidth), -- 2.45.2