@@ 46,31 46,31 @@ func (handler *ImageResizeHandler) ScaleImage(image image.Image, options *Option
newHeight = handler.ScaleHeightByRatio(float64(sz.Max.Y), ratio)
}
- // fit the screen
+ //Stretch the picture to overspread the terminal
if ratio == 1 &&
options.FixedWidth == -1 &&
options.FixedHeight == -1 &&
- options.FitScreen {
- fitWidth, fitHeight, err := handler.CalcProportionalFittingScreenSize(image)
+ options.StretchedScreen {
+ screenWidth, screenHeight, err := handler.terminal.ScreenSize()
if err != nil {
log.Fatal(err)
}
- newWidth = int(fitWidth)
- newHeight = int(fitHeight)
+ newWidth = int(screenWidth)
+ newHeight = int(screenHeight)
}
- //Stretch the picture to overspread the terminal
+ // fit the screen
if ratio == 1 &&
options.FixedWidth == -1 &&
options.FixedHeight == -1 &&
- !options.FitScreen &&
- options.StretchedScreen {
- screenWidth, screenHeight, err := handler.terminal.ScreenSize()
+ options.FitScreen &&
+ !options.StretchedScreen {
+ fitWidth, fitHeight, err := handler.CalcProportionalFittingScreenSize(image)
if err != nil {
log.Fatal(err)
}
- newWidth = int(screenWidth)
- newHeight = int(screenHeight)
+ newWidth = int(fitWidth)
+ newHeight = int(fitHeight)
}
newImage = resize.Resize(uint(newWidth), uint(newHeight), image, resize.Lanczos3)