@@ -659,46 +659,47 @@ void ffLogoPrint(void)
659659 return ;
660660
661661 //Make sure the logo path is set correctly.
662- if (! updateLogoPath ())
662+ if (updateLogoPath ())
663663 {
664- if (instance .config .display .showErrors )
665- fprintf (stderr , "Logo: Failed to resolve logo source: %s\n" , options -> source .chars );
666- return ;
667- }
664+ if (ffStrbufEndsWithIgnCaseS (& options -> source , ".raw" ))
665+ {
666+ if (logoPrintFileIfExists (false, true))
667+ return ;
668+ }
668669
669- if (ffStrbufEndsWithIgnCaseS (& options -> source , ".raw" ))
670- {
671- if (logoPrintFileIfExists (false, true))
670+ if (!ffStrbufEndsWithIgnCaseS (& options -> source , ".txt" ))
671+ {
672+ const FFTerminalResult * terminal = ffDetectTerminal ();
673+
674+ //Terminal emulators that support kitty graphics protocol.
675+ bool supportsKitty =
676+ ffStrbufIgnCaseEqualS (& terminal -> processName , "kitty" ) ||
677+ ffStrbufIgnCaseEqualS (& terminal -> processName , "konsole" ) ||
678+ ffStrbufIgnCaseEqualS (& terminal -> processName , "wezterm" ) ||
679+ ffStrbufIgnCaseEqualS (& terminal -> processName , "wayst" ) ||
680+ ffStrbufIgnCaseEqualS (& terminal -> processName , "ghostty" ) ||
681+ #ifdef __APPLE__
682+ ffStrbufIgnCaseEqualS (& terminal -> processName , "WarpTerminal" ) ||
683+ #else
684+ ffStrbufIgnCaseEqualS (& terminal -> processName , "warp" ) ||
685+ #endif
686+ false;
687+
688+ //Try to load the logo as an image. If it succeeds, print it and return.
689+ if (logoPrintImageIfExists (supportsKitty ? FF_LOGO_TYPE_IMAGE_KITTY : FF_LOGO_TYPE_IMAGE_CHAFA , false))
690+ return ;
691+ }
692+
693+ //Try to load the logo as a file. If it succeeds, print it and return.
694+ if (logoPrintFileIfExists (true, false))
672695 return ;
673696 }
674-
675- if (!ffStrbufEndsWithIgnCaseS (& options -> source , ".txt" ))
697+ else
676698 {
677- const FFTerminalResult * terminal = ffDetectTerminal ();
678-
679- //Terminal emulators that support kitty graphics protocol.
680- bool supportsKitty =
681- ffStrbufIgnCaseEqualS (& terminal -> processName , "kitty" ) ||
682- ffStrbufIgnCaseEqualS (& terminal -> processName , "konsole" ) ||
683- ffStrbufIgnCaseEqualS (& terminal -> processName , "wezterm" ) ||
684- ffStrbufIgnCaseEqualS (& terminal -> processName , "wayst" ) ||
685- ffStrbufIgnCaseEqualS (& terminal -> processName , "ghostty" ) ||
686- #ifdef __APPLE__
687- ffStrbufIgnCaseEqualS (& terminal -> processName , "WarpTerminal" ) ||
688- #else
689- ffStrbufIgnCaseEqualS (& terminal -> processName , "warp" ) ||
690- #endif
691- false;
692-
693- //Try to load the logo as an image. If it succeeds, print it and return.
694- if (logoPrintImageIfExists (supportsKitty ? FF_LOGO_TYPE_IMAGE_KITTY : FF_LOGO_TYPE_IMAGE_CHAFA , false))
695- return ;
699+ if (instance .config .display .showErrors )
700+ fprintf (stderr , "Logo: Failed to resolve logo source: %s\n" , options -> source .chars );
696701 }
697702
698- //Try to load the logo as a file. If it succeeds, print it and return.
699- if (logoPrintFileIfExists (true, false))
700- return ;
701-
702703 logoPrintDetected (FF_LOGO_SIZE_UNKNOWN );
703704}
704705
0 commit comments