[gthumb] raw: added the possibility to interrupt the processing



commit 3d61677a9e4fea310e1ac0784d369e4e100911bf
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Mon Jun 24 18:15:58 2013 +0200

    raw: added the possibility to interrupt the processing

 extensions/raw_files/main.c |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/extensions/raw_files/main.c b/extensions/raw_files/main.c
index 3d2a6f6..40822d9 100644
--- a/extensions/raw_files/main.c
+++ b/extensions/raw_files/main.c
@@ -209,13 +209,16 @@ _libraw_get_tranform (libraw_data_t *raw_data)
 }
 
 
-static void
-swap_int (int *a,
-         int *b)
+#endif
+
+
+static int
+_libraw_progress_cb (void                 *callback_data,
+                    enum LibRaw_progress  stage,
+                    int                   iteration,
+                    int                   expected)
 {
-       int tmp = *a;
-       *a = *b;
-       *b = tmp;
+       return g_cancellable_is_cancelled ((GCancellable *) callback_data) ? 1 : 0;
 }
 
 
@@ -241,6 +244,7 @@ _cairo_image_surface_create_from_raw (GInputStream  *istream,
                goto fatal_error;
        }
 
+       libraw_set_progress_handler (raw_data, _libraw_progress_cb, cancellable);
 
        if (! _g_input_stream_read_all (istream, &buffer, &size, cancellable, error))
                goto fatal_error;


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