diff options
author | Stefano Karapetsas <[email protected]> | 2013-09-17 12:48:20 -0700 |
---|---|---|
committer | Stefano Karapetsas <[email protected]> | 2013-09-17 12:48:20 -0700 |
commit | f66654cf3fc9c5a94003a2823fc64c18a7b987a4 (patch) | |
tree | e3f64388db659d6e716befde96106bc72be27221 /libcaja-private/caja-file.c | |
parent | 8537b86bf3a08581e2886ea1ec052ce23cea9bb1 (diff) | |
parent | 74986734b3b188b702513028b53e54cafbb8c85b (diff) | |
download | caja-f66654cf3fc9c5a94003a2823fc64c18a7b987a4.tar.bz2 caja-f66654cf3fc9c5a94003a2823fc64c18a7b987a4.tar.xz |
Merge pull request #154 from romovs/master
fixed thumbnail frame not being displayed for some files
Diffstat (limited to 'libcaja-private/caja-file.c')
-rw-r--r-- | libcaja-private/caja-file.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/libcaja-private/caja-file.c b/libcaja-private/caja-file.c index 84d799f9..85f8a9ce 100644 --- a/libcaja-private/caja-file.c +++ b/libcaja-private/caja-file.c @@ -4276,7 +4276,9 @@ caja_file_get_icon (CajaFile *file, pixbuf = caja_icon_info_get_pixbuf (icon); if (pixbuf != NULL) { - caja_ui_frame_image (&pixbuf); + if (!file->details->is_launcher && !gdk_pixbuf_get_has_alpha (pixbuf)) { + caja_ui_frame_image (&pixbuf); + } g_object_unref (icon); icon = caja_icon_info_new_for_pixbuf (pixbuf); @@ -4320,7 +4322,14 @@ caja_file_get_icon (CajaFile *file, MAX (h * scale, 1), GDK_INTERP_BILINEAR); - caja_ui_frame_image (&scaled_pixbuf); + /* Render frames only for thumbnails of non-image files + and for images with no alpha channel. */ + gboolean is_image = strncmp(eel_ref_str_peek (file->details->mime_type), "image/", 6) == 0; + if (!is_image || + is_image && !gdk_pixbuf_get_has_alpha (raw_pixbuf)) { + caja_ui_frame_image (&scaled_pixbuf); + } + g_object_unref (raw_pixbuf); /* Don't scale up if more than 25%, then read the original |