Redirect STDOUT to file
This commit is contained in:
@@ -442,6 +442,11 @@ cimg_library::CImg<unsigned char> load_rgb_CImg(const char * const filename) {
|
||||
int main(int argc, char* argv[]) {
|
||||
struct winsize w;
|
||||
ioctl(STDOUT_FILENO, TIOCGWINSZ, &w);
|
||||
|
||||
//If redirect STDOUT to one file ( col and row == 0 )
|
||||
if(w.ws_col == 0 && w.ws_row == 0) {
|
||||
ioctl(0, TIOCGWINSZ, &w);
|
||||
}
|
||||
|
||||
int maxWidth = w.ws_col * 4;
|
||||
int maxHeight = w.ws_row * 8;
|
||||
|
||||
Reference in New Issue
Block a user