stefanhaustein / TerminalImageViewer

Small C++ program to display images in a (modern) terminal using RGB ANSI codes and unicode block graphics characters
Other
1.56k stars 111 forks source link

Fix tall thumbnails #49

Closed AlanDeSmet closed 5 years ago

AlanDeSmet commented 5 years ago

The aspect ratio of images is preserved in thumbnail mode.

I extracted the resizing logic for full mode and put it in place for thumbnail mode.

Should resolve https://github.com/stefanhaustein/TerminalImageViewer/issues/48

AlanDeSmet commented 5 years ago

I'm happy to follow just about style. :-)

252455f changes size::operator* to size::scaled and moves fit_within to size::fitted_within, with *this being the size to be refitted within the target size.