Image: don't try to read image file with --logo none

This commit is contained in:
李通洲
2023-01-03 15:13:39 +08:00
parent f3db4e49b6
commit a307977ec1
4 changed files with 6 additions and 1 deletions
+2
View File
@@ -979,6 +979,7 @@ static void parseOption(FFinstance* instance, FFdata* data, const char* key, con
instance->config.logo.paddingTop = 0;
instance->config.logo.paddingRight = 0;
instance->config.logo.paddingLeft = 0;
instance->config.logo.type = FF_LOGO_TYPE_NONE;
}
}
else if(startsWith(key, "--logo"))
@@ -998,6 +999,7 @@ static void parseOption(FFinstance* instance, FFdata* data, const char* key, con
"iterm", FF_LOGO_TYPE_IMAGE_ITERM,
"chafa", FF_LOGO_TYPE_IMAGE_CHAFA,
"raw", FF_LOGO_TYPE_IMAGE_RAW,
"none", FF_LOGO_TYPE_NONE,
NULL
);
}
+1
View File
@@ -38,6 +38,7 @@ typedef enum FFLogoType
FF_LOGO_TYPE_IMAGE_ITERM, //image file, printed as iterm graphics protocol
FF_LOGO_TYPE_IMAGE_CHAFA, //image file, printed as ascii art using libchafa
FF_LOGO_TYPE_IMAGE_RAW, //image file, printed as raw binary string
FF_LOGO_TYPE_NONE, //--logo none
} FFLogoType;
typedef enum FFBinaryPrefixType
+2
View File
@@ -339,6 +339,8 @@ static void logoPrintKnownType(FFinstance* instance)
else
successfull = logoPrintFileIfExists(instance, false, true);
}
else if(instance->config.logo.type == FF_LOGO_TYPE_NONE)
logoApplyColorsDetected(instance);
else //image
successfull = logoPrintImageIfExists(instance, instance->config.logo.type);