Commit 27aa0432 authored by Marius Meisenzahl's avatar Marius Meisenzahl
Browse files

Always load fallback image and use it if needed

parent 72728fc7
Pipeline #231705 failed with stage
in 1 minute and 56 seconds
......@@ -139,7 +139,7 @@ struct _ply_boot_splash_plugin
ply_image_t *header_image;
ply_image_t *background_tile_image;
ply_image_t *background_bgrt_image;
char *background_bgrt_fallback_image_path;
ply_image_t *background_bgrt_fallback_image;
ply_image_t *watermark_image;
ply_list_t *views;
......@@ -1049,7 +1049,9 @@ create_plugin (ply_key_file_t *key_file)
plugin->background_tile_image = ply_image_new (image_path);
free (image_path);
asprintf (&plugin->background_bgrt_fallback_image_path, "%s/bgrt-fallback.png", image_dir);
asprintf (&image_path, "%s/bgrt-fallback.png", image_dir);
plugin->background_bgrt_fallback_image = ply_image_new (image_path);
free (image_path);
asprintf (&image_path, "%s/watermark.png", image_dir);
plugin->watermark_image = ply_image_new (image_path);
......@@ -1246,8 +1248,8 @@ destroy_plugin (ply_boot_splash_plugin_t *plugin)
if (plugin->background_bgrt_image != NULL)
ply_image_free (plugin->background_bgrt_image);
if (plugin->background_bgrt_fallback_image_path != NULL)
free (plugin->background_bgrt_fallback_image_path);
if (plugin->background_bgrt_fallback_image != NULL)
ply_image_free (plugin->background_bgrt_fallback);
if (plugin->watermark_image != NULL)
ply_image_free (plugin->watermark_image);
......@@ -1663,9 +1665,10 @@ show_splash_screen (ply_boot_splash_plugin_t *plugin,
} else {
ply_trace ("loading background bgrt fallback image");
plugin->background_bgrt_image = ply_image_new (plugin->background_bgrt_fallback_image_path);
free (plugin->background_bgrt_fallback_image_path);
if (!ply_image_load (plugin->background_bgrt_image)) {
if (ply_image_load (plugin->background_bgrt_fallback_image)) {
plugin->background_bgrt_image = plugin->background_bgrt_fallback_image;
plugin->background_bgrt_fallback_image = NULL;
} else {
ply_image_free (plugin->background_bgrt_image);
plugin->background_bgrt_image = NULL;
for (i = 0; i < PLY_BOOT_SPLASH_MODE_COUNT; i++)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment