diff --git a/config.def.h b/config.def.h index df67372ef1e7..0ee0c3194862 100644 --- a/config.def.h +++ b/config.def.h @@ -1511,6 +1511,8 @@ #define DEFAULT_PLAYLIST_USE_FILENAME false +#define DEFAULT_PLAYLIST_ALLOW_NON_PNG false + /* Show Menu start-up screen on boot. */ #define DEFAULT_MENU_SHOW_START_SCREEN true diff --git a/configuration.c b/configuration.c index 1784d7d2f627..8141d0af3fd0 100644 --- a/configuration.c +++ b/configuration.c @@ -2155,6 +2155,7 @@ static struct config_bool_setting *populate_settings_bool( SETTING_BOOL("playlist_fuzzy_archive_match", &settings->bools.playlist_fuzzy_archive_match, true, DEFAULT_PLAYLIST_FUZZY_ARCHIVE_MATCH, false); SETTING_BOOL("playlist_portable_paths", &settings->bools.playlist_portable_paths, true, DEFAULT_PLAYLIST_PORTABLE_PATHS, false); SETTING_BOOL("playlist_use_filename", &settings->bools.playlist_use_filename, true, DEFAULT_PLAYLIST_USE_FILENAME, false); + SETTING_BOOL("playlist_allow_non_png", &settings->bools.playlist_allow_non_png, true, DEFAULT_PLAYLIST_ALLOW_NON_PNG, false); SETTING_BOOL("frame_time_counter_reset_after_fastforwarding", &settings->bools.frame_time_counter_reset_after_fastforwarding, true, false, false); SETTING_BOOL("frame_time_counter_reset_after_load_state", &settings->bools.frame_time_counter_reset_after_load_state, true, false, false); diff --git a/configuration.h b/configuration.h index 9cdad7e245db..91ed43a4d208 100644 --- a/configuration.h +++ b/configuration.h @@ -1053,6 +1053,7 @@ typedef struct settings bool playlist_fuzzy_archive_match; bool playlist_portable_paths; bool playlist_use_filename; + bool playlist_allow_non_png; bool quit_press_twice; bool vibrate_on_keypress; diff --git a/gfx/gfx_thumbnail_path.c b/gfx/gfx_thumbnail_path.c index cb881b1813c4..ec55766673ad 100644 --- a/gfx/gfx_thumbnail_path.c +++ b/gfx/gfx_thumbnail_path.c @@ -669,8 +669,13 @@ bool gfx_thumbnail_update_path( path_data->content_img_full, PATH_MAX_LENGTH * sizeof(char)); } thumbnail_found = path_is_valid(thumbnail_path); - /* Try alternative file extensions in turn */ - for(i=1;ibools.playlist_allow_non_png && + !thumbnail_found && + thumbnail_path[0]!='\0' && + icontent_img, PATH_MAX_LENGTH * sizeof(char)); thumbnail_found = path_is_valid(thumbnail_path); } - for(i=1;ibools.playlist_allow_non_png && + !thumbnail_found && + icontent_img_short, PATH_MAX_LENGTH * sizeof(char)); thumbnail_found = path_is_valid(thumbnail_path); } - for(i=1;ibools.playlist_allow_non_png && + !thumbnail_found && + i