@@ -81,7 +81,7 @@ int main(int argc, char *argv[])
8181 while ((c = getopt (argc , argv , "H:w:l:r:hct" )) != -1 )
8282 switch (c ) {
8383 case 'H' :
84- rows = strtol (optarg , & num , 0 ) >> 1 ;
84+ rows = strtol (optarg , & num , 0 );
8585 if (adjust_to_width ) {
8686 // only either adjust to width or adjust to height is allowed, but not both.
8787 printf (ERR_WIDTH_OR_HEIGHT );
@@ -138,7 +138,7 @@ int main(int argc, char *argv[])
138138
139139 // if precision is 2 we can use the terminal full width/height. Otherwise we can only use half
140140 max_cols = terminal_columns () / (2 / precision );
141- max_rows = terminal_rows () * 2 / ( 2 / precision ) ;
141+ max_rows = terminal_rows () * precision ;
142142
143143 if (strcmp (file , "-" ) == 0 ) {
144144 img_load_from_stdin (& img );
@@ -157,7 +157,7 @@ int main(int argc, char *argv[])
157157 scale_cols = cols / (float )img .width ;
158158 img_resize (& img , scale_cols , scale_cols );
159159 } else if (rows > 0 && rows < img .height ) {
160- scale_rows = ( float )( rows * 2 ) / (float )img .height ;
160+ scale_rows = rows / (float )img .height ;
161161 img_resize (& img , scale_rows , scale_rows );
162162 }
163163
0 commit comments