[nautilus/wip/csoriano/jp2debug] debugging jp2



commit b2151f2c5fd441e36ad6654d267f87315c3c854b
Author: Carlos Soriano <csoriano gnome org>
Date:   Fri Jan 8 16:36:47 2016 +0100

    debugging jp2

 libnautilus-private/nautilus-thumbnails.c |   19 ++++++++++++++++---
 src/nautilus-window.c                     |   12 ++++++++++++
 2 files changed, 28 insertions(+), 3 deletions(-)
---
diff --git a/libnautilus-private/nautilus-thumbnails.c b/libnautilus-private/nautilus-thumbnails.c
index e04ed84..6458c28 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 830b1cf..18ab90f 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));
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]