@@ -72,14 +72,14 @@ static bool printImageIterm(bool printError)
7272
7373 if (!options -> width || !options -> height )
7474 {
75- if (! options -> separate )
75+ if (options -> position == FF_LOGO_POSITION_LEFT )
7676 {
7777 ffStrbufAppendF (& buf , "\e[2J\e[3J\e[%u;%uH" ,
7878 (unsigned ) options -> paddingTop ,
7979 (unsigned ) options -> paddingLeft
8080 );
8181 }
82- else
82+ else if ( options -> position == FF_LOGO_POSITION_TOP )
8383 {
8484 ffStrbufAppendNC (& buf , options -> paddingTop , '\n' );
8585 ffStrbufAppendNC (& buf , options -> paddingLeft , ' ' );
@@ -90,7 +90,7 @@ static bool printImageIterm(bool printError)
9090 ffStrbufAppendF (& buf , "\e]1337;File=inline=1:%s\a" , base64 .chars );
9191 ffWriteFDBuffer (FFUnixFD2NativeFD (STDOUT_FILENO ), & buf );
9292
93- if (! options -> separate )
93+ if (options -> position == FF_LOGO_POSITION_LEFT )
9494 {
9595 uint16_t X = 0 , Y = 0 ;
9696 const char * error = ffGetTerminalResponse ("\e[6n" , "\e[%hu;%huR" , & Y , & X );
@@ -103,7 +103,7 @@ static bool printImageIterm(bool printError)
103103 instance .state .logoHeight = Y ;
104104 fputs ("\e[H" , stdout );
105105 }
106- else
106+ else if ( options -> position == FF_LOGO_POSITION_TOP )
107107 {
108108 instance .state .logoWidth = instance .state .logoHeight = 0 ;
109109 ffPrintCharTimes ('\n' , options -> paddingRight );
@@ -120,13 +120,13 @@ static bool printImageIterm(bool printError)
120120 base64 .chars
121121 );
122122
123- if (! options -> separate )
123+ if (options -> position == FF_LOGO_POSITION_LEFT )
124124 {
125125 instance .state .logoWidth = options -> width + options -> paddingLeft + options -> paddingRight ;
126126 instance .state .logoHeight = options -> paddingTop + options -> height ;
127127 ffStrbufAppendF (& buf , "\e[%uA" , (unsigned ) instance .state .logoHeight );
128128 }
129- else
129+ else if ( options -> position == FF_LOGO_POSITION_TOP )
130130 {
131131 instance .state .logoWidth = instance .state .logoHeight = 0 ;
132132 ffStrbufAppendNC (& buf , options -> paddingRight , '\n' );
@@ -152,15 +152,15 @@ static bool printImageKittyDirect(bool printError)
152152
153153 if (!options -> width || !options -> height )
154154 {
155- if (! options -> separate )
155+ if (options -> position == FF_LOGO_POSITION_LEFT )
156156 {
157157 // We must clear the entre screen to make sure that terminal buffer won't scroll up
158158 printf ("\e[2J\e[3J\e[%u;%uH" ,
159159 (unsigned ) options -> paddingTop ,
160160 (unsigned ) options -> paddingLeft
161161 );
162162 }
163- else
163+ else if ( options -> position == FF_LOGO_POSITION_TOP )
164164 {
165165 ffPrintCharTimes ('\n' , options -> paddingTop );
166166 ffPrintCharTimes (' ' , options -> paddingLeft );
@@ -171,7 +171,7 @@ static bool printImageKittyDirect(bool printError)
171171 else
172172 printf ("\e_Ga=T,f=100,t=f;%s\e\\" , base64 .chars );
173173 fflush (stdout );
174- if (! options -> separate )
174+ if (options -> position == FF_LOGO_POSITION_LEFT )
175175 {
176176 uint16_t X = 0 , Y = 0 ;
177177 const char * error = ffGetTerminalResponse ("\e[6n" , "\e[%hu;%huR" , & Y , & X );
@@ -184,7 +184,7 @@ static bool printImageKittyDirect(bool printError)
184184 instance .state .logoHeight = Y ;
185185 fputs ("\e[H" , stdout );
186186 }
187- else
187+ else if ( options -> position == FF_LOGO_POSITION_TOP )
188188 {
189189 instance .state .logoWidth = instance .state .logoHeight = 0 ;
190190 ffPrintCharTimes ('\n' , options -> paddingRight );
@@ -200,13 +200,13 @@ static bool printImageKittyDirect(bool printError)
200200 (unsigned ) options -> height ,
201201 base64 .chars
202202 );
203- if (! options -> separate )
203+ if (options -> position == FF_LOGO_POSITION_LEFT )
204204 {
205205 instance .state .logoWidth = options -> width + options -> paddingLeft + options -> paddingRight ;
206206 instance .state .logoHeight = options -> paddingTop + options -> height ;
207207 printf ("\e[%uA" , (unsigned ) instance .state .logoHeight );
208208 }
209- else
209+ else if ( options -> position == FF_LOGO_POSITION_TOP )
210210 {
211211 instance .state .logoWidth = instance .state .logoHeight = 0 ;
212212 ffPrintCharTimes ('\n' , options -> paddingRight );
0 commit comments