diff options
author | Jules Maselbas <jmaselbas@kalray.eu> | 2022-01-18 00:02:34 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2022-01-20 09:14:39 +0100 |
commit | cad82010e259d419c24679267c43990abd7b7482 (patch) | |
tree | a0fffb5a347dd4612380d2d888cadb1280e483d6 /lib/logo/logo.c | |
parent | 8763acc2e80d073ede8ba1d9fb66ec3165d4f630 (diff) | |
download | barebox-cad82010e259d419c24679267c43990abd7b7482.tar.gz barebox-cad82010e259d419c24679267c43990abd7b7482.tar.xz |
logo: Enable image format selection for the logo
Enables the selection of an image format to be used for the built-in
barebox logo. The default image format is set to png, has it was the
only choice before. This also adds bmp as the other option.
Signed-off-by: Jules Maselbas <jmaselbas@kalray.eu>
Link: https://lore.barebox.org/20220117230235.13549-5-jmaselbas@kalray.eu
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'lib/logo/logo.c')
-rw-r--r-- | lib/logo/logo.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/logo/logo.c b/lib/logo/logo.c index 8349b060ac..200eb992b3 100644 --- a/lib/logo/logo.c +++ b/lib/logo/logo.c @@ -32,8 +32,14 @@ static void load_logo(int width, void *start, void *end) { char *filename; size_t size = end - start; + char *ext = ""; - filename = basprintf("/logo/barebox-logo-%d.png", width); + if (IS_ENABLED(CONFIG_BAREBOX_LOGO_PNG)) + ext = "png"; + else if (IS_ENABLED(CONFIG_BAREBOX_LOGO_BMP)) + ext = "bmp"; + + filename = basprintf("/logo/barebox-logo-%d.%s", width, ext); write_file(filename, start, size); free(filename); } |