summaryrefslogtreecommitdiff
path: root/libcaja-private
diff options
context:
space:
mode:
authorromovs <[email protected]>2013-08-25 01:40:02 +0300
committerStefano Karapetsas <[email protected]>2013-09-17 21:51:56 +0200
commit9320cd66487c8da1a8ca3c514cd001515dba83f6 (patch)
treefa2ae3e9b13d3ec4a59fca8adf70ee70fe36708f /libcaja-private
parentecb6347e185f5973f2315060042ac3dc77b5fdb3 (diff)
downloadcaja-9320cd66487c8da1a8ca3c514cd001515dba83f6.tar.bz2
caja-9320cd66487c8da1a8ca3c514cd001515dba83f6.tar.xz
fixed thumbnail frame not being displayed for some files. also fixes #135.
Diffstat (limited to 'libcaja-private')
-rw-r--r--libcaja-private/caja-file.c13
-rw-r--r--libcaja-private/caja-ui-utilities.c9
2 files changed, 11 insertions, 11 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
diff --git a/libcaja-private/caja-ui-utilities.c b/libcaja-private/caja-ui-utilities.c
index 9732b6d9..8077e975 100644
--- a/libcaja-private/caja-ui-utilities.c
+++ b/libcaja-private/caja-ui-utilities.c
@@ -287,21 +287,12 @@ caja_ui_frame_image (GdkPixbuf **pixbuf)
{
GdkPixbuf *pixbuf_with_frame, *frame;
int left_offset, top_offset, right_offset, bottom_offset;
- int size;
frame = caja_get_thumbnail_frame ();
if (frame == NULL) {
return;
}
- size = MAX (gdk_pixbuf_get_width (*pixbuf),
- gdk_pixbuf_get_height (*pixbuf));
-
- /* We don't want frames around small icons */
- if (size < 128 && gdk_pixbuf_get_has_alpha (*pixbuf)) {
- return;
- }
-
left_offset = CAJA_THUMBNAIL_FRAME_LEFT;
top_offset = CAJA_THUMBNAIL_FRAME_TOP;
right_offset = CAJA_THUMBNAIL_FRAME_RIGHT;