Logo (Image): fix spelling of --preserve-aspect-ratio

Fix #614
This commit is contained in:
李通洲
2023-11-07 08:49:22 +08:00
parent a95b60167c
commit aae66aa966
6 changed files with 12 additions and 11 deletions
+1
View File
@@ -10,6 +10,7 @@ Features:
Bugfixes:
* Fix unitialized variables (#609)
* Fix spelling of `--preserve-aspect-ratio` (#614)
Logos:
+1 -1
View File
@@ -156,7 +156,7 @@
"description": "Whether to print the remaining logo, if it has more lines than modules to display",
"default": false
},
"preserveAspectRadio": {
"preserveAspectRatio": {
"type": "boolean",
"description": "Whether to preserve the aspect ratio of the logo. Supported by iTerm image protocol",
"default": false
+1 -1
View File
@@ -35,7 +35,7 @@ Logo options:
--logo-type <type>: Set the type of the logo given; must be auto, builtin, file, file-raw, data, data-raw, sixel, kitty, iterm or chafa
--logo-width <width>: Set the width of the logo (in characters), if it is an image. Required for iTerm image protocol
--logo-height <height>: Set the height of the logo (in characters), if it is an image. Required for iTerm image protocol
--logo-preserve-aspect-radio <?value>: Set if the logo should fill the specified width and height as much as possible without stretching. Supported by iTerm image protocol
--logo-preserve-aspect-ratio <?value>: Set if the logo should fill the specified width and height as much as possible without stretching. Supported by iTerm image protocol
--logo-color-[1-9] <color>: Overwrite a color in the logo
--logo-padding <padding>: Set the padding on the left and the right of the logo
--logo-padding-left <padding>: Set the padding on the left of the logo
+1 -1
View File
@@ -95,7 +95,7 @@ static bool printImageIterm(void)
ffStrbufAppendF(&buf, "\e]1337;File=inline=1;width=%u;height=%u;preserveAspectRatio=%u:%s\a\n",
(unsigned) options->width,
(unsigned) options->height,
(unsigned) options->preserveAspectRadio,
(unsigned) options->preserveAspectRatio,
base64.chars
);
+7 -7
View File
@@ -15,7 +15,7 @@ void ffOptionsInitLogo(FFOptionsLogo* options)
options->paddingLeft = 0;
options->paddingRight = 4;
options->printRemaining = true;
options->preserveAspectRadio = false;
options->preserveAspectRatio = false;
options->recache = false;
options->separate = false;
@@ -113,8 +113,8 @@ logoType:
options->paddingRight = ffOptionParseUInt32(key, value);
else if(strcasecmp(subKey, "print-remaining") == 0)
options->printRemaining = ffOptionParseBoolean(value);
else if(strcasecmp(subKey, "preserve-aspect-radio") == 0)
options->preserveAspectRadio = ffOptionParseBoolean(value);
else if(strcasecmp(subKey, "preserve-aspect-ratio") == 0)
options->preserveAspectRatio = ffOptionParseBoolean(value);
else if(strcasecmp(subKey, "recache") == 0)
options->recache = ffOptionParseBoolean(value);
else if(strcasecmp(subKey, "separate") == 0)
@@ -327,9 +327,9 @@ const char* ffOptionsParseLogoJsonConfig(FFOptionsLogo* options, yyjson_val* roo
options->printRemaining = yyjson_get_bool(val);
continue;
}
else if (strcasecmp(key, "preserveAspectRadio") == 0)
else if (strcasecmp(key, "preserveAspectRatio") == 0)
{
options->preserveAspectRadio = yyjson_get_bool(val);
options->preserveAspectRatio = yyjson_get_bool(val);
continue;
}
else if (strcasecmp(key, "recache") == 0)
@@ -504,8 +504,8 @@ void ffOptionsGenerateLogoJsonConfig(FFOptionsLogo* options, yyjson_mut_doc* doc
if (options->printRemaining != defaultOptions.printRemaining)
yyjson_mut_obj_add_bool(doc, obj, "printRemaining", options->printRemaining);
if (options->preserveAspectRadio != defaultOptions.preserveAspectRadio)
yyjson_mut_obj_add_bool(doc, obj, "preserveAspectRadio", options->preserveAspectRadio);
if (options->preserveAspectRatio != defaultOptions.preserveAspectRatio)
yyjson_mut_obj_add_bool(doc, obj, "preserveAspectRatio", options->preserveAspectRatio);
if (options->recache != defaultOptions.recache)
yyjson_mut_obj_add_bool(doc, obj, "recache", options->recache);
+1 -1
View File
@@ -34,7 +34,7 @@ typedef struct FFOptionsLogo
uint32_t paddingLeft;
uint32_t paddingRight;
bool printRemaining;
bool preserveAspectRadio;
bool preserveAspectRatio;
bool recache;
bool separate;