From 08a40d13ce2e7b733251bc0f2b09f615ab50f8d8 Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Sat, 17 Oct 2020 22:05:17 +0200 Subject: [Icons] Check both small and big caps for extention. --- source/dialogs/filebrowser.c | 5 +++-- source/rofi-icon-fetcher.c | 8 +++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/source/dialogs/filebrowser.c b/source/dialogs/filebrowser.c index 37ec7725..22c94cf5 100644 --- a/source/dialogs/filebrowser.c +++ b/source/dialogs/filebrowser.c @@ -348,8 +348,9 @@ static cairo_surface_t *_get_icon ( const Mode *sw, unsigned int selected_line, if ( dr->icon_fetch_uid > 0 ) { return rofi_icon_fetcher_get ( dr->icon_fetch_uid ); } - if ( dr->path && (g_str_has_suffix(dr->path, ".png") || g_str_has_suffix(dr->path, "jpeg") || g_str_has_suffix(dr->path, "jpg") || g_str_has_suffix(dr->path, ".svg") )){ - dr->icon_fetch_uid = rofi_icon_fetcher_query ( dr->path, height ); + if ( dr->path && (g_str_has_suffix(dr->path, ".png") || g_str_has_suffix(dr->path, ".jpeg") || g_str_has_suffix(dr->path, ".jpg") || g_str_has_suffix(dr->path, ".svg") || + g_str_has_suffix(dr->path, ".PNG") || g_str_has_suffix(dr->path, ".JPEG") || g_str_has_suffix(dr->path, ".JPG") || g_str_has_suffix(dr->path, ".SVG") )){ + dr->icon_fetch_uid = rofi_icon_fetcher_query ( dr->path, height ); } else { dr->icon_fetch_uid = rofi_icon_fetcher_query ( icon_name[dr->type], height ); } diff --git a/source/rofi-icon-fetcher.c b/source/rofi-icon-fetcher.c index 60ede6f3..e718d19d 100644 --- a/source/rofi-icon-fetcher.c +++ b/source/rofi-icon-fetcher.c @@ -252,13 +252,15 @@ static void rofi_icon_fetcher_worker ( thread_state *sdata, G_GNUC_UNUSED gpoint } } cairo_surface_t *icon_surf = NULL; - if ( g_str_has_suffix ( icon_path, ".png" ) ) { + if ( g_str_has_suffix ( icon_path, ".png" ) || g_str_has_suffix ( icon_path, ".PNG" ) ) { icon_surf = cairo_image_surface_create_from_png ( icon_path ); } - else if ( g_str_has_suffix ( icon_path, ".jpeg" ) || g_str_has_suffix ( icon_path, ".jpg" ) ) { + else if ( g_str_has_suffix ( icon_path, ".jpeg" ) || g_str_has_suffix ( icon_path, ".jpg" ) || + g_str_has_suffix ( icon_path, ".JPEG" ) || g_str_has_suffix ( icon_path, ".JPG" ) + ) { icon_surf = cairo_image_surface_create_from_jpeg ( icon_path ); } - else if ( g_str_has_suffix ( icon_path, ".svg" ) ) { + else if ( g_str_has_suffix ( icon_path, ".svg" ) || g_str_has_suffix ( icon_path, ".SVG" ) ) { icon_surf = cairo_image_surface_create_from_svg ( icon_path, sentry->size ); } else { -- cgit v1.2.3