summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Soriano <csoriano@gnome.org>2016-01-08 16:36:47 +0100
committerCarlos Soriano <csoriano@gnome.org>2016-01-08 16:36:47 +0100
commitb2151f2c5fd441e36ad6654d267f87315c3c854b (patch)
tree9dda9ccac1892cc63e948f69d2d8817daba39f8b
parent1c6e94d38995a37727b17da14fd3dbc2edca6163 (diff)
downloadnautilus-b2151f2c5fd441e36ad6654d267f87315c3c854b.tar.gz
debugging jp2
-rw-r--r--libnautilus-private/nautilus-thumbnails.c19
-rw-r--r--src/nautilus-window.c12
2 files changed, 28 insertions, 3 deletions
diff --git a/libnautilus-private/nautilus-thumbnails.c b/libnautilus-private/nautilus-thumbnails.c
index e04ed84ba..6458c2810 100644
--- a/libnautilus-private/nautilus-thumbnails.c
+++ b/libnautilus-private/nautilus-thumbnails.c
@@ -47,7 +47,7 @@
#include "nautilus-file-private.h"
/* turn this on to see messages about thumbnail creation */
-#if 0
+#if 1
#define DEBUG_THUMBNAILS
#endif
@@ -452,6 +452,18 @@ nautilus_create_thumbnail (NautilusFile *file)
pthread_mutex_unlock (&thumbnails_mutex);
}
+static void
+test_jp2 ()
+{
+ GdkPixbuf *pixbuf;
+ GError *error = NULL;
+ g_print ("####TESTING\n");
+
+ pixbuf = gdk_pixbuf_new_from_file ("/home/csoriano/Downloads/3/jp2/cats.jp2", &error);
+ if (!pixbuf || error)
+ g_print ("EERROROROR %s\n", error->message);
+}
+
/* thumbnail_thread is invoked as a separate thread to to make thumbnails. */
static gpointer
thumbnail_thread_start (gpointer data)
@@ -517,7 +529,6 @@ thumbnail_thread_start (gpointer data)
#ifdef DEBUG_THUMBNAILS
g_message ("(Thumbnail Thread) Unlocking mutex\n");
#endif
- pthread_mutex_unlock (&thumbnails_mutex);
time (&current_time);
@@ -540,7 +551,7 @@ thumbnail_thread_start (gpointer data)
g_message ("(Thumbnail Thread) Creating thumbnail: %s\n",
info->image_uri);
#endif
-
+ test_jp2();
pixbuf = gnome_desktop_thumbnail_factory_generate_thumbnail (thumbnail_factory,
info->image_uri,
info->mime_type);
@@ -569,5 +580,7 @@ thumbnail_thread_start (gpointer data)
g_idle_add_full (G_PRIORITY_HIGH_IDLE,
thumbnail_thread_notify_file_changed,
g_strdup (info->image_uri), NULL);
+
+ pthread_mutex_unlock (&thumbnails_mutex);
}
}
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index 830b1cffc..18ab90f06 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -286,12 +286,24 @@ action_bookmark_current_location (GSimpleAction *action,
nautilus_bookmark_list_append (nautilus_application_get_bookmarks (app),
nautilus_window_slot_get_bookmark (slot));
}
+static void
+test_jp2 ()
+{
+ GdkPixbuf *pixbuf;
+ GError *error = NULL;
+ g_print ("####TESTING\n");
+
+ pixbuf = gdk_pixbuf_new_from_file ("/home/csoriano/Downloads/3/jp2/cats.jp2", &error);
+ if (!pixbuf || error)
+ g_print ("EERROROROR %s\n", error->message);
+}
static void
action_new_tab (GSimpleAction *action,
GVariant *state,
gpointer user_data)
{
+ test_jp2();
nautilus_window_new_tab (NAUTILUS_WINDOW (user_data));
}