diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2018-05-01 14:34:32 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2018-05-01 14:34:32 +0200 |
commit | 49120f48474fc8fdc2448c75d961bc238213cfac (patch) | |
tree | 05bcdb95d65a807cf0f1ffffd066c09074b5cf56 /src/camera/GPhoto.c | |
parent | 2492891f112caac6076ce49721d9d5d78a152c3a (diff) |
New upstream version 0.28.2upstream/0.28.2
Diffstat (limited to 'src/camera/GPhoto.c')
-rw-r--r-- | src/camera/GPhoto.c | 2053 |
1 files changed, 958 insertions, 1095 deletions
diff --git a/src/camera/GPhoto.c b/src/camera/GPhoto.c index 6deedf6..b1865ed 100644 --- a/src/camera/GPhoto.c +++ b/src/camera/GPhoto.c @@ -19,10 +19,10 @@ #include <gphoto2/gphoto2-filesys.h> #include <gphoto2/gphoto2-result.h> #include <gphoto2/gphoto2-port-result.h> +#include <gphoto2/gphoto2-file.h> #include <gphoto2/gphoto2-port-info-list.h> #include <gio/gio.h> #include <gdk-pixbuf/gdk-pixbuf.h> -#include <gphoto2/gphoto2-file.h> #include <fcntl.h> #include <sys/types.h> #include <errno.h> @@ -75,6 +75,7 @@ typedef struct _PhotoMetadataClass PhotoMetadataClass; #define _g_free0(var) (var = (g_free (var), NULL)) #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) #define _media_metadata_unref0(var) ((var == NULL) ? NULL : (var = (media_metadata_unref (var), NULL))) +#define _g_bytes_unref0(var) ((var == NULL) ? NULL : (var = (g_bytes_unref (var), NULL))) #define TYPE_PHOTO_PREVIEW (photo_preview_get_type ()) #define PHOTO_PREVIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PHOTO_PREVIEW, PhotoPreview)) @@ -182,6 +183,7 @@ static void gp_spin_idle_wrapper_real_progress_update (GPContextWrapper* base, g #define GP_MAX_FILENAME_LENGTH 63 #define GP_MAX_BASEDIR_LENGTH 255 gboolean gp_get_info (GPContext* context, Camera* camera, const gchar* folder, const gchar* filename, CameraFileInfo* info, GError** error); +GBytes* gp_camera_file_to_bytes (GPContext* context, CameraFile* file); gpointer media_metadata_ref (gpointer instance); void media_metadata_unref (gpointer instance); GParamSpec* param_spec_media_metadata (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); @@ -194,8 +196,8 @@ PhotoMetadata* gp_get_fallback_metadata (Camera* camera, GPContext* context, con PhotoMetadata* photo_metadata_new (void); PhotoMetadata* photo_metadata_construct (GType object_type); void media_metadata_read_from_file (MediaMetadata* self, GFile* file, GError** error); -GdkPixbuf* gp_load_preview (GPContext* context, Camera* camera, const gchar* folder, const gchar* filename, guint8** raw, int* raw_length1, gsize* raw_length, GError** error); -guint8* gp_load_file_into_buffer (GPContext* context, Camera* camera, const gchar* folder, const gchar* filename, CameraFileType filetype, int* result_length1, GError** error); +GdkPixbuf* gp_load_preview (GPContext* context, Camera* camera, const gchar* folder, const gchar* filename, gchar* * preview_md5, GError** error); +GBytes* gp_load_file_into_buffer (GPContext* context, Camera* camera, const gchar* folder, const gchar* filename, CameraFileType filetype, GError** error); guint photo_metadata_get_preview_count (PhotoMetadata* self); gpointer photo_preview_ref (gpointer instance); void photo_preview_unref (gpointer instance); @@ -205,17 +207,13 @@ void value_take_photo_preview (GValue* value, gpointer v_object); gpointer value_get_photo_preview (const GValue* value); GType photo_preview_get_type (void) G_GNUC_CONST; PhotoPreview* photo_metadata_get_preview (PhotoMetadata* self, guint number); -guint8* photo_preview_flatten (PhotoPreview* self, int* result_length1, GError** error); -static guint8* _vala_array_dup23 (guint8* self, int length); +GBytes* photo_preview_flatten (PhotoPreview* self, GError** error); #define IMPORT_PREVIEW_MAX_SCALE 128 GdkPixbuf* gp_load_image (GPContext* context, Camera* camera, const gchar* folder, const gchar* filename, GError** error); GInputStream* gp_load_file_into_stream (GPContext* context, Camera* camera, const gchar* folder, const gchar* filename, CameraFileType filetype, GError** error); void gp_save_image (GPContext* context, Camera* camera, const gchar* folder, const gchar* filename, GFile* dest_file, GError** error); PhotoMetadata* gp_load_metadata (GPContext* context, Camera* camera, const gchar* folder, const gchar* filename, GError** error); -void photo_metadata_read_from_app1_segment (PhotoMetadata* self, guint8* buffer, int buffer_length1, gint length, GError** error); -static guint8* _vala_array_dup24 (guint8* self, int length); -void gp_on_mins_destroyed (void* data); -static void _gp_on_mins_destroyed_gdestroy_notify (void* data); +void photo_metadata_read_from_app1_segment (PhotoMetadata* self, GBytes* buffer, GError** error); GFile* app_dirs_get_temp_dir (void); @@ -227,28 +225,28 @@ GQuark gphoto_error_quark (void) { static void _gp_context_wrapper_on_idle_gp_context_idle_func (GPContext* context, gpointer self) { #line 18 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" gp_context_wrapper_on_idle ((GPContextWrapper*) self, context); -#line 231 "GPhoto.c" +#line 229 "GPhoto.c" } static void _gp_context_wrapper_on_error_gp_context_error_func (GPContext* context, const gchar* text, gpointer self) { #line 19 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" gp_context_wrapper_on_error ((GPContextWrapper*) self, context, text); -#line 238 "GPhoto.c" +#line 236 "GPhoto.c" } static void _gp_context_wrapper_on_status_gp_context_status_func (GPContext* context, const gchar* text, gpointer self) { #line 20 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" gp_context_wrapper_on_status ((GPContextWrapper*) self, context, text); -#line 245 "GPhoto.c" +#line 243 "GPhoto.c" } static void _gp_context_wrapper_on_message_gp_context_message_func (GPContext* context, const gchar* text, gpointer self) { #line 21 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" gp_context_wrapper_on_message ((GPContextWrapper*) self, context, text); -#line 252 "GPhoto.c" +#line 250 "GPhoto.c" } @@ -257,21 +255,21 @@ static guint _gp_context_wrapper_on_progress_start_gp_context_progress_start_fun result = gp_context_wrapper_on_progress_start ((GPContextWrapper*) self, context, target, text); #line 22 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" return result; -#line 261 "GPhoto.c" +#line 259 "GPhoto.c" } static void _gp_context_wrapper_on_progress_update_gp_context_progress_update_func (GPContext* context, guint id, gfloat current, gpointer self) { #line 22 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" gp_context_wrapper_on_progress_update ((GPContextWrapper*) self, context, id, current); -#line 268 "GPhoto.c" +#line 266 "GPhoto.c" } static void _gp_context_wrapper_on_progress_stop_gp_context_progress_stop_func (GPContext* context, guint id, gpointer self) { #line 22 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" gp_context_wrapper_on_progress_stop ((GPContextWrapper*) self, context, id); -#line 275 "GPhoto.c" +#line 273 "GPhoto.c" } @@ -306,14 +304,14 @@ GPContextWrapper* gp_context_wrapper_construct (GType object_type) { gp_context_set_progress_funcs (_tmp4_, _gp_context_wrapper_on_progress_start_gp_context_progress_start_func, _gp_context_wrapper_on_progress_update_gp_context_progress_update_func, _gp_context_wrapper_on_progress_stop_gp_context_progress_stop_func, self); #line 17 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" return self; -#line 310 "GPhoto.c" +#line 308 "GPhoto.c" } GPContextWrapper* gp_context_wrapper_new (void) { #line 17 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" return gp_context_wrapper_construct (GP_TYPE_CONTEXT_WRAPPER); -#line 317 "GPhoto.c" +#line 315 "GPhoto.c" } @@ -326,14 +324,14 @@ void gp_context_wrapper_idle (GPContextWrapper* self) { g_return_if_fail (GP_IS_CONTEXT_WRAPPER (self)); #line 25 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" GP_CONTEXT_WRAPPER_GET_CLASS (self)->idle (self); -#line 330 "GPhoto.c" +#line 328 "GPhoto.c" } static void gp_context_wrapper_real_error (GPContextWrapper* self, const gchar* text, void* data) { #line 28 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_return_if_fail (text != NULL); -#line 337 "GPhoto.c" +#line 335 "GPhoto.c" } @@ -342,14 +340,14 @@ void gp_context_wrapper_error (GPContextWrapper* self, const gchar* text, void* g_return_if_fail (GP_IS_CONTEXT_WRAPPER (self)); #line 28 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" GP_CONTEXT_WRAPPER_GET_CLASS (self)->error (self, text, data); -#line 346 "GPhoto.c" +#line 344 "GPhoto.c" } static void gp_context_wrapper_real_status (GPContextWrapper* self, const gchar* text, void* data) { #line 31 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_return_if_fail (text != NULL); -#line 353 "GPhoto.c" +#line 351 "GPhoto.c" } @@ -358,14 +356,14 @@ void gp_context_wrapper_status (GPContextWrapper* self, const gchar* text, void* g_return_if_fail (GP_IS_CONTEXT_WRAPPER (self)); #line 31 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" GP_CONTEXT_WRAPPER_GET_CLASS (self)->status (self, text, data); -#line 362 "GPhoto.c" +#line 360 "GPhoto.c" } static void gp_context_wrapper_real_message (GPContextWrapper* self, const gchar* text, void* data) { #line 34 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_return_if_fail (text != NULL); -#line 369 "GPhoto.c" +#line 367 "GPhoto.c" } @@ -374,14 +372,14 @@ void gp_context_wrapper_message (GPContextWrapper* self, const gchar* text, void g_return_if_fail (GP_IS_CONTEXT_WRAPPER (self)); #line 34 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" GP_CONTEXT_WRAPPER_GET_CLASS (self)->message (self, text, data); -#line 378 "GPhoto.c" +#line 376 "GPhoto.c" } static void gp_context_wrapper_real_progress_start (GPContextWrapper* self, gfloat current, const gchar* text, void* data) { #line 37 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_return_if_fail (text != NULL); -#line 385 "GPhoto.c" +#line 383 "GPhoto.c" } @@ -390,7 +388,7 @@ void gp_context_wrapper_progress_start (GPContextWrapper* self, gfloat current, g_return_if_fail (GP_IS_CONTEXT_WRAPPER (self)); #line 37 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" GP_CONTEXT_WRAPPER_GET_CLASS (self)->progress_start (self, current, text, data); -#line 394 "GPhoto.c" +#line 392 "GPhoto.c" } @@ -403,7 +401,7 @@ void gp_context_wrapper_progress_update (GPContextWrapper* self, gfloat current, g_return_if_fail (GP_IS_CONTEXT_WRAPPER (self)); #line 40 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" GP_CONTEXT_WRAPPER_GET_CLASS (self)->progress_update (self, current, data); -#line 407 "GPhoto.c" +#line 405 "GPhoto.c" } @@ -416,7 +414,7 @@ void gp_context_wrapper_progress_stop (GPContextWrapper* self) { g_return_if_fail (GP_IS_CONTEXT_WRAPPER (self)); #line 43 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" GP_CONTEXT_WRAPPER_GET_CLASS (self)->progress_stop (self); -#line 420 "GPhoto.c" +#line 418 "GPhoto.c" } @@ -427,7 +425,7 @@ static void gp_context_wrapper_on_idle (GPContextWrapper* self, GPContext* conte g_return_if_fail (context != NULL); #line 47 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" gp_context_wrapper_idle (self); -#line 431 "GPhoto.c" +#line 429 "GPhoto.c" } @@ -443,7 +441,7 @@ static void gp_context_wrapper_on_error (GPContextWrapper* self, GPContext* cont _tmp0_ = text; #line 51 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" gp_context_wrapper_error (self, _tmp0_, NULL); -#line 447 "GPhoto.c" +#line 445 "GPhoto.c" } @@ -459,7 +457,7 @@ static void gp_context_wrapper_on_status (GPContextWrapper* self, GPContext* con _tmp0_ = text; #line 55 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" gp_context_wrapper_status (self, _tmp0_, NULL); -#line 463 "GPhoto.c" +#line 461 "GPhoto.c" } @@ -475,7 +473,7 @@ static void gp_context_wrapper_on_message (GPContextWrapper* self, GPContext* co _tmp0_ = text; #line 59 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" gp_context_wrapper_message (self, _tmp0_, NULL); -#line 479 "GPhoto.c" +#line 477 "GPhoto.c" } @@ -499,7 +497,7 @@ static guint gp_context_wrapper_on_progress_start (GPContextWrapper* self, GPCon result = (guint) 0; #line 65 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" return result; -#line 503 "GPhoto.c" +#line 501 "GPhoto.c" } @@ -513,7 +511,7 @@ static void gp_context_wrapper_on_progress_update (GPContextWrapper* self, GPCon _tmp0_ = current; #line 69 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" gp_context_wrapper_progress_update (self, _tmp0_, NULL); -#line 517 "GPhoto.c" +#line 515 "GPhoto.c" } @@ -524,14 +522,14 @@ static void gp_context_wrapper_on_progress_stop (GPContextWrapper* self, GPConte g_return_if_fail (context != NULL); #line 73 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" gp_context_wrapper_progress_stop (self); -#line 528 "GPhoto.c" +#line 526 "GPhoto.c" } static void gp_value_context_wrapper_init (GValue* value) { #line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" value->data[0].v_pointer = NULL; -#line 535 "GPhoto.c" +#line 533 "GPhoto.c" } @@ -540,7 +538,7 @@ static void gp_value_context_wrapper_free_value (GValue* value) { if (value->data[0].v_pointer) { #line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" gp_context_wrapper_unref (value->data[0].v_pointer); -#line 544 "GPhoto.c" +#line 542 "GPhoto.c" } } @@ -550,11 +548,11 @@ static void gp_value_context_wrapper_copy_value (const GValue* src_value, GValue if (src_value->data[0].v_pointer) { #line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" dest_value->data[0].v_pointer = gp_context_wrapper_ref (src_value->data[0].v_pointer); -#line 554 "GPhoto.c" +#line 552 "GPhoto.c" } else { #line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" dest_value->data[0].v_pointer = NULL; -#line 558 "GPhoto.c" +#line 556 "GPhoto.c" } } @@ -562,37 +560,37 @@ static void gp_value_context_wrapper_copy_value (const GValue* src_value, GValue static gpointer gp_value_context_wrapper_peek_pointer (const GValue* value) { #line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" return value->data[0].v_pointer; -#line 566 "GPhoto.c" +#line 564 "GPhoto.c" } static gchar* gp_value_context_wrapper_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) { #line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" if (collect_values[0].v_pointer) { -#line 573 "GPhoto.c" +#line 571 "GPhoto.c" GPContextWrapper * object; object = collect_values[0].v_pointer; #line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" if (object->parent_instance.g_class == NULL) { #line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL); -#line 580 "GPhoto.c" +#line 578 "GPhoto.c" } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) { #line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL); -#line 584 "GPhoto.c" +#line 582 "GPhoto.c" } #line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" value->data[0].v_pointer = gp_context_wrapper_ref (object); -#line 588 "GPhoto.c" +#line 586 "GPhoto.c" } else { #line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" value->data[0].v_pointer = NULL; -#line 592 "GPhoto.c" +#line 590 "GPhoto.c" } #line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" return NULL; -#line 596 "GPhoto.c" +#line 594 "GPhoto.c" } @@ -603,25 +601,25 @@ static gchar* gp_value_context_wrapper_lcopy_value (const GValue* value, guint n if (!object_p) { #line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value)); -#line 607 "GPhoto.c" +#line 605 "GPhoto.c" } #line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" if (!value->data[0].v_pointer) { #line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" *object_p = NULL; -#line 613 "GPhoto.c" +#line 611 "GPhoto.c" } else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) { #line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" *object_p = value->data[0].v_pointer; -#line 617 "GPhoto.c" +#line 615 "GPhoto.c" } else { #line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" *object_p = gp_context_wrapper_ref (value->data[0].v_pointer); -#line 621 "GPhoto.c" +#line 619 "GPhoto.c" } #line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" return NULL; -#line 625 "GPhoto.c" +#line 623 "GPhoto.c" } @@ -635,7 +633,7 @@ GParamSpec* gp_param_spec_context_wrapper (const gchar* name, const gchar* nick, G_PARAM_SPEC (spec)->value_type = object_type; #line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" return G_PARAM_SPEC (spec); -#line 639 "GPhoto.c" +#line 637 "GPhoto.c" } @@ -644,7 +642,7 @@ gpointer gp_value_get_context_wrapper (const GValue* value) { g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GP_TYPE_CONTEXT_WRAPPER), NULL); #line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" return value->data[0].v_pointer; -#line 648 "GPhoto.c" +#line 646 "GPhoto.c" } @@ -664,17 +662,17 @@ void gp_value_set_context_wrapper (GValue* value, gpointer v_object) { value->data[0].v_pointer = v_object; #line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" gp_context_wrapper_ref (value->data[0].v_pointer); -#line 668 "GPhoto.c" +#line 666 "GPhoto.c" } else { #line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" value->data[0].v_pointer = NULL; -#line 672 "GPhoto.c" +#line 670 "GPhoto.c" } #line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" if (old) { #line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" gp_context_wrapper_unref (old); -#line 678 "GPhoto.c" +#line 676 "GPhoto.c" } } @@ -693,17 +691,17 @@ void gp_value_take_context_wrapper (GValue* value, gpointer v_object) { g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value))); #line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" value->data[0].v_pointer = v_object; -#line 697 "GPhoto.c" +#line 695 "GPhoto.c" } else { #line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" value->data[0].v_pointer = NULL; -#line 701 "GPhoto.c" +#line 699 "GPhoto.c" } #line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" if (old) { #line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" gp_context_wrapper_unref (old); -#line 707 "GPhoto.c" +#line 705 "GPhoto.c" } } @@ -727,7 +725,7 @@ static void gp_context_wrapper_class_init (GPContextWrapperClass * klass) { ((GPContextWrapperClass *) klass)->progress_update = (void (*) (GPContextWrapper *, gfloat, void*)) gp_context_wrapper_real_progress_update; #line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" ((GPContextWrapperClass *) klass)->progress_stop = (void (*) (GPContextWrapper *)) gp_context_wrapper_real_progress_stop; -#line 731 "GPhoto.c" +#line 729 "GPhoto.c" } @@ -739,7 +737,7 @@ static void gp_context_wrapper_instance_init (GPContextWrapper * self) { self->context = _tmp0_; #line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" self->ref_count = 1; -#line 743 "GPhoto.c" +#line 741 "GPhoto.c" } @@ -751,7 +749,7 @@ static void gp_context_wrapper_finalize (GPContextWrapper * obj) { g_signal_handlers_destroy (self); #line 15 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _gp_context_unref0 (self->context); -#line 755 "GPhoto.c" +#line 753 "GPhoto.c" } @@ -776,7 +774,7 @@ gpointer gp_context_wrapper_ref (gpointer instance) { g_atomic_int_inc (&self->ref_count); #line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" return instance; -#line 780 "GPhoto.c" +#line 778 "GPhoto.c" } @@ -789,7 +787,7 @@ void gp_context_wrapper_unref (gpointer instance) { GP_CONTEXT_WRAPPER_GET_CLASS (self)->finalize (self); #line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_type_free_instance ((GTypeInstance *) self); -#line 793 "GPhoto.c" +#line 791 "GPhoto.c" } } @@ -800,14 +798,14 @@ GPSpinIdleWrapper* gp_spin_idle_wrapper_construct (GType object_type) { self = (GPSpinIdleWrapper*) gp_context_wrapper_construct (object_type); #line 79 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" return self; -#line 804 "GPhoto.c" +#line 802 "GPhoto.c" } GPSpinIdleWrapper* gp_spin_idle_wrapper_new (void) { #line 79 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" return gp_spin_idle_wrapper_construct (GP_TYPE_SPIN_IDLE_WRAPPER); -#line 811 "GPhoto.c" +#line 809 "GPhoto.c" } @@ -819,7 +817,7 @@ static void gp_spin_idle_wrapper_real_idle (GPContextWrapper* base) { GP_CONTEXT_WRAPPER_CLASS (gp_spin_idle_wrapper_parent_class)->idle (G_TYPE_CHECK_INSTANCE_CAST (self, GP_TYPE_CONTEXT_WRAPPER, GPContextWrapper)); #line 85 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" spin_event_loop (); -#line 823 "GPhoto.c" +#line 821 "GPhoto.c" } @@ -837,7 +835,7 @@ static void gp_spin_idle_wrapper_real_progress_update (GPContextWrapper* base, g GP_CONTEXT_WRAPPER_CLASS (gp_spin_idle_wrapper_parent_class)->progress_update (G_TYPE_CHECK_INSTANCE_CAST (self, GP_TYPE_CONTEXT_WRAPPER, GPContextWrapper), _tmp0_, _tmp1_); #line 91 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" spin_event_loop (); -#line 841 "GPhoto.c" +#line 839 "GPhoto.c" } @@ -848,7 +846,7 @@ static void gp_spin_idle_wrapper_class_init (GPSpinIdleWrapperClass * klass) { ((GPContextWrapperClass *) klass)->idle = (void (*) (GPContextWrapper *)) gp_spin_idle_wrapper_real_idle; #line 78 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" ((GPContextWrapperClass *) klass)->progress_update = (void (*) (GPContextWrapper *, gfloat, void*)) gp_spin_idle_wrapper_real_progress_update; -#line 852 "GPhoto.c" +#line 850 "GPhoto.c" } @@ -902,7 +900,7 @@ gboolean gp_get_info (GPContext* context, Camera* camera, const gchar* folder, c if (_tmp3_ > GP_MAX_BASEDIR_LENGTH) { #line 104 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp0_ = TRUE; -#line 906 "GPhoto.c" +#line 904 "GPhoto.c" } else { const gchar* _tmp4_; gint _tmp5_; @@ -915,11 +913,11 @@ gboolean gp_get_info (GPContext* context, Camera* camera, const gchar* folder, c _tmp6_ = _tmp5_; #line 104 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp0_ = _tmp6_ > GP_MAX_FILENAME_LENGTH; -#line 919 "GPhoto.c" +#line 917 "GPhoto.c" } #line 104 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" if (_tmp0_) { -#line 923 "GPhoto.c" +#line 921 "GPhoto.c" CameraFileInfo _tmp7_ = {0}; #line 105 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" (_vala_info); @@ -931,15 +929,15 @@ gboolean gp_get_info (GPContext* context, Camera* camera, const gchar* folder, c if (info) { #line 107 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" *info = _vala_info; -#line 935 "GPhoto.c" +#line 933 "GPhoto.c" } else { #line 107 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" (_vala_info); -#line 939 "GPhoto.c" +#line 937 "GPhoto.c" } #line 107 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" return result; -#line 943 "GPhoto.c" +#line 941 "GPhoto.c" } #line 110 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp8_ = camera; @@ -961,7 +959,7 @@ gboolean gp_get_info (GPContext* context, Camera* camera, const gchar* folder, c _tmp14_ = res; #line 111 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" if (_tmp14_ != GP_OK) { -#line 965 "GPhoto.c" +#line 963 "GPhoto.c" int _tmp15_; const gchar* _tmp16_; const gchar* _tmp17_; @@ -987,7 +985,7 @@ gboolean gp_get_info (GPContext* context, Camera* camera, const gchar* folder, c g_propagate_error (error, _inner_error_); #line 112 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" return _tmp21_; -#line 991 "GPhoto.c" +#line 989 "GPhoto.c" } #line 115 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" result = TRUE; @@ -995,15 +993,99 @@ gboolean gp_get_info (GPContext* context, Camera* camera, const gchar* folder, c if (info) { #line 115 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" *info = _vala_info; -#line 999 "GPhoto.c" +#line 997 "GPhoto.c" } else { #line 115 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" (_vala_info); -#line 1003 "GPhoto.c" +#line 1001 "GPhoto.c" } #line 115 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" return result; -#line 1007 "GPhoto.c" +#line 1005 "GPhoto.c" +} + + +static gpointer _GPHOTO_REF_FILE0 (gpointer self) { +#line 131 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + return self ? GPHOTO_REF_FILE (self) : NULL; +#line 1012 "GPhoto.c" +} + + +GBytes* gp_camera_file_to_bytes (GPContext* context, CameraFile* file) { + GBytes* result = NULL; + guint8* data = NULL; + gulong data_len = 0UL; + int res = 0; + CameraFile* _tmp0_; + guint8* _tmp1_ = NULL; + gulong _tmp2_ = 0UL; + int _tmp3_; + int _tmp4_; + guint8* buffer = NULL; + guint8* _tmp5_; + gint buffer_length1; + gint _buffer_size_; + gulong _tmp6_; + gint _tmp7_; + guint8* _tmp8_; + gint _tmp8__length1; + CameraFile* _tmp9_; + CameraFile* _tmp10_; + GBytes* _tmp11_; +#line 118 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + g_return_val_if_fail (context != NULL, NULL); +#line 118 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + g_return_val_if_fail (file != NULL, NULL); +#line 124 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp0_ = file; +#line 124 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp3_ = gp_file_get_data_and_size (_tmp0_, &_tmp1_, &_tmp2_); +#line 124 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + data = _tmp1_; +#line 124 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + data_len = _tmp2_; +#line 124 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + res = _tmp3_; +#line 125 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp4_ = res; +#line 125 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + if (_tmp4_ != GP_OK) { +#line 126 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + result = NULL; +#line 126 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + return result; +#line 1059 "GPhoto.c" + } +#line 128 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp5_ = data; +#line 128 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + buffer = (guint8*) _tmp5_; +#line 128 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + buffer_length1 = sizeof (guint8) / sizeof (guint8); +#line 128 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _buffer_size_ = buffer_length1; +#line 129 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp6_ = data_len; +#line 129 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + buffer_length1 = (gint) _tmp6_; +#line 129 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp7_ = buffer_length1; +#line 131 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp8_ = buffer; +#line 131 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp8__length1 = buffer_length1; +#line 131 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp9_ = file; +#line 131 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp10_ = _GPHOTO_REF_FILE0 (_tmp9_); +#line 131 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp11_ = g_bytes_new_with_free_func (_tmp8_, (gsize) _tmp8__length1, gp_file_unref, _tmp10_); +#line 131 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + result = _tmp11_; +#line 131 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + return result; +#line 1089 "GPhoto.c" } @@ -1036,7 +1118,7 @@ static gchar* string_slice (const gchar* self, glong start, glong end) { _tmp2_ = start; #line 1357 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" if (_tmp2_ < ((glong) 0)) { -#line 1040 "GPhoto.c" +#line 1122 "GPhoto.c" glong _tmp3_; glong _tmp4_; #line 1358 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" @@ -1045,13 +1127,13 @@ static gchar* string_slice (const gchar* self, glong start, glong end) { _tmp4_ = start; #line 1358 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" start = _tmp3_ + _tmp4_; -#line 1049 "GPhoto.c" +#line 1131 "GPhoto.c" } #line 1360 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" _tmp5_ = end; #line 1360 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" if (_tmp5_ < ((glong) 0)) { -#line 1055 "GPhoto.c" +#line 1137 "GPhoto.c" glong _tmp6_; glong _tmp7_; #line 1361 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" @@ -1060,13 +1142,13 @@ static gchar* string_slice (const gchar* self, glong start, glong end) { _tmp7_ = end; #line 1361 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" end = _tmp6_ + _tmp7_; -#line 1064 "GPhoto.c" +#line 1146 "GPhoto.c" } #line 1363 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" _tmp9_ = start; #line 1363 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" if (_tmp9_ >= ((glong) 0)) { -#line 1070 "GPhoto.c" +#line 1152 "GPhoto.c" glong _tmp10_; glong _tmp11_; #line 1363 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" @@ -1075,11 +1157,11 @@ static gchar* string_slice (const gchar* self, glong start, glong end) { _tmp11_ = string_length; #line 1363 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" _tmp8_ = _tmp10_ <= _tmp11_; -#line 1079 "GPhoto.c" +#line 1161 "GPhoto.c" } else { #line 1363 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" _tmp8_ = FALSE; -#line 1083 "GPhoto.c" +#line 1165 "GPhoto.c" } #line 1363 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" g_return_val_if_fail (_tmp8_, NULL); @@ -1087,7 +1169,7 @@ static gchar* string_slice (const gchar* self, glong start, glong end) { _tmp13_ = end; #line 1364 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" if (_tmp13_ >= ((glong) 0)) { -#line 1091 "GPhoto.c" +#line 1173 "GPhoto.c" glong _tmp14_; glong _tmp15_; #line 1364 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" @@ -1096,11 +1178,11 @@ static gchar* string_slice (const gchar* self, glong start, glong end) { _tmp15_ = string_length; #line 1364 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" _tmp12_ = _tmp14_ <= _tmp15_; -#line 1100 "GPhoto.c" +#line 1182 "GPhoto.c" } else { #line 1364 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" _tmp12_ = FALSE; -#line 1104 "GPhoto.c" +#line 1186 "GPhoto.c" } #line 1364 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" g_return_val_if_fail (_tmp12_, NULL); @@ -1122,7 +1204,7 @@ static gchar* string_slice (const gchar* self, glong start, glong end) { result = _tmp21_; #line 1366 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" return result; -#line 1126 "GPhoto.c" +#line 1208 "GPhoto.c" } @@ -1146,53 +1228,53 @@ PhotoMetadata* gp_get_fallback_metadata (Camera* camera, GPContext* context, con PhotoMetadata* metadata = NULL; PhotoMetadata* _tmp17_; GError * _inner_error_ = NULL; -#line 121 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 137 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_return_val_if_fail (camera != NULL, NULL); -#line 121 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 137 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_return_val_if_fail (context != NULL, NULL); -#line 121 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 137 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_return_val_if_fail (folder != NULL, NULL); -#line 121 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 137 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_return_val_if_fail (filename != NULL, NULL); -#line 122 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 138 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" sifs = NULL; -#line 123 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 139 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" count = 0; -#line 124 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 140 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp0_ = camera; -#line 124 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 140 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp1_ = context; -#line 124 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 140 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" gp_camera_get_storageinfo (_tmp0_, &sifs, &_tmp2_, _tmp1_); -#line 124 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 140 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" count = _tmp2_; -#line 127 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 143 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp3_ = camera; -#line 127 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 143 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" gp_camera_get_port_info (_tmp3_, &_tmp4_); -#line 127 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 143 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" (port_info); -#line 127 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 143 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" port_info = _tmp4_; -#line 130 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 146 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" gp_port_info_get_path (port_info, &_tmp5_); -#line 130 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 146 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _g_free0 (path); -#line 130 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 146 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp6_ = g_strdup (_tmp5_); -#line 130 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 146 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" path = _tmp6_; -#line 132 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 148 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp7_ = g_strdup ("disk:"); -#line 132 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 148 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" prefix = _tmp7_; -#line 133 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 149 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp8_ = path; -#line 133 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 149 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp9_ = g_str_has_prefix (_tmp8_, prefix); -#line 133 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 149 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" if (_tmp9_) { -#line 1196 "GPhoto.c" +#line 1278 "GPhoto.c" const gchar* _tmp10_; gint _tmp11_; gint _tmp12_; @@ -1200,43 +1282,43 @@ PhotoMetadata* gp_get_fallback_metadata (Camera* camera, GPContext* context, con gint _tmp14_; gint _tmp15_; gchar* _tmp16_; -#line 134 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 150 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp10_ = path; -#line 134 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 150 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp11_ = strlen (prefix); -#line 134 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 150 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp12_ = _tmp11_; -#line 134 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 150 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp13_ = path; -#line 134 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 150 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp14_ = strlen (_tmp13_); -#line 134 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 150 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp15_ = _tmp14_; -#line 134 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 150 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp16_ = string_slice (_tmp10_, (glong) _tmp12_, (glong) _tmp15_); -#line 134 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 150 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _g_free0 (path); -#line 134 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 150 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" path = _tmp16_; -#line 1222 "GPhoto.c" +#line 1304 "GPhoto.c" } else { -#line 136 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 152 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" result = NULL; -#line 136 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 152 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _g_free0 (prefix); -#line 136 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 152 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _g_free0 (path); -#line 136 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 152 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" (port_info); -#line 136 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 152 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" return result; -#line 1234 "GPhoto.c" +#line 1316 "GPhoto.c" } -#line 138 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 154 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp17_ = photo_metadata_new (); -#line 138 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 154 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" metadata = _tmp17_; -#line 1240 "GPhoto.c" +#line 1322 "GPhoto.c" { PhotoMetadata* _tmp18_; const gchar* _tmp19_; @@ -1250,463 +1332,394 @@ PhotoMetadata* gp_get_fallback_metadata (Camera* camera, GPContext* context, con gchar* _tmp27_; GFile* _tmp28_; GFile* _tmp29_; -#line 140 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 156 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp18_ = metadata; -#line 140 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 156 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp19_ = path; -#line 140 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 156 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp20_ = folder; -#line 140 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 156 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp21_ = g_strconcat (_tmp19_, _tmp20_, NULL); -#line 140 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 156 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp22_ = _tmp21_; -#line 140 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 156 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp23_ = g_strconcat (_tmp22_, "/", NULL); -#line 140 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 156 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp24_ = _tmp23_; -#line 140 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 156 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp25_ = filename; -#line 140 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 156 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp26_ = g_strconcat (_tmp24_, _tmp25_, NULL); -#line 140 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 156 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp27_ = _tmp26_; -#line 140 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 156 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp28_ = g_file_new_for_path (_tmp27_); -#line 140 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 156 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp29_ = _tmp28_; -#line 140 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 156 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" media_metadata_read_from_file (G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, TYPE_MEDIA_METADATA, MediaMetadata), _tmp29_, &_inner_error_); -#line 140 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 156 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _g_object_unref0 (_tmp29_); -#line 140 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 156 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _g_free0 (_tmp27_); -#line 140 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 156 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _g_free0 (_tmp24_); -#line 140 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 156 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _g_free0 (_tmp22_); -#line 140 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 156 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" if (G_UNLIKELY (_inner_error_ != NULL)) { -#line 1290 "GPhoto.c" - goto __catch62_g_error; +#line 1372 "GPhoto.c" + goto __catch69_g_error; } } - goto __finally62; - __catch62_g_error: + goto __finally69; + __catch69_g_error: { -#line 139 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 155 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_clear_error (&_inner_error_); -#line 139 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 155 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _inner_error_ = NULL; -#line 142 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 158 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _media_metadata_unref0 (metadata); -#line 142 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 158 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" metadata = NULL; -#line 1305 "GPhoto.c" +#line 1387 "GPhoto.c" } - __finally62: -#line 139 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + __finally69: +#line 155 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" if (G_UNLIKELY (_inner_error_ != NULL)) { -#line 139 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 155 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _media_metadata_unref0 (metadata); -#line 139 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 155 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _g_free0 (prefix); -#line 139 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 155 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _g_free0 (path); -#line 139 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 155 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" (port_info); -#line 139 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 155 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); -#line 139 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 155 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_clear_error (&_inner_error_); -#line 139 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 155 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" return NULL; -#line 1324 "GPhoto.c" +#line 1406 "GPhoto.c" } -#line 145 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 161 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" result = metadata; -#line 145 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 161 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _g_free0 (prefix); -#line 145 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 161 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _g_free0 (path); -#line 145 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 161 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" (port_info); -#line 145 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 161 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" return result; -#line 1336 "GPhoto.c" +#line 1418 "GPhoto.c" } -static guint8* _vala_array_dup23 (guint8* self, int length) { -#line 172 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - return g_memdup (self, length * sizeof (guint8)); -#line 1343 "GPhoto.c" +static gpointer _g_bytes_ref0 (gpointer self) { +#line 185 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + return self ? g_bytes_ref (self) : NULL; +#line 1425 "GPhoto.c" } -GdkPixbuf* gp_load_preview (GPContext* context, Camera* camera, const gchar* folder, const gchar* filename, guint8** raw, int* raw_length1, gsize* raw_length, GError** error) { - guint8* _vala_raw = NULL; - int _vala_raw_length1 = 0; - gsize _vala_raw_length = 0UL; +GdkPixbuf* gp_load_preview (GPContext* context, Camera* camera, const gchar* folder, const gchar* filename, gchar* * preview_md5, GError** error) { + gchar* _vala_preview_md5 = NULL; GdkPixbuf* result = NULL; - guint8* _tmp25_; - gint _tmp25__length1; - guint8* _tmp26_; - gint _tmp26__length1; + GBytes* raw = NULL; + GBytes* out_bytes = NULL; + GBytes* _tmp25_; + GBytes* _tmp26_; + GBytes* _tmp27_; + gchar* _tmp28_; GMemoryInputStream* mins = NULL; - guint8* _tmp27_; - gint _tmp27__length1; - guint8* _tmp28_; - gint _tmp28__length1; - GMemoryInputStream* _tmp29_; - GdkPixbuf* _tmp30_ = NULL; - GMemoryInputStream* _tmp31_; - GdkPixbuf* _tmp32_; + GBytes* _tmp29_; + GMemoryInputStream* _tmp30_; + GdkPixbuf* _tmp31_ = NULL; + GMemoryInputStream* _tmp32_; GdkPixbuf* _tmp33_; + GdkPixbuf* _tmp34_; GError * _inner_error_ = NULL; -#line 148 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 164 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_return_val_if_fail (context != NULL, NULL); -#line 148 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 164 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_return_val_if_fail (camera != NULL, NULL); -#line 148 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 164 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_return_val_if_fail (folder != NULL, NULL); -#line 148 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 164 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_return_val_if_fail (filename != NULL, NULL); -#line 150 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _vala_raw = (g_free (_vala_raw), NULL); -#line 150 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _vala_raw = NULL; -#line 150 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _vala_raw_length1 = 0; -#line 151 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _vala_raw_length = (gsize) 0; -#line 1383 "GPhoto.c" +#line 166 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + raw = NULL; +#line 167 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + out_bytes = NULL; +#line 168 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _g_free0 (_vala_preview_md5); +#line 168 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _vala_preview_md5 = NULL; +#line 1462 "GPhoto.c" { - guint8* _tmp0_ = NULL; + GBytes* _tmp0_ = NULL; GPContext* _tmp1_; Camera* _tmp2_; const gchar* _tmp3_; const gchar* _tmp4_; - gint _tmp5_; - guint8* _tmp6_; - gint _tmp0__length1; - gint __tmp0__size_; - guint8* _tmp7_; - gint _tmp7__length1; -#line 154 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + GBytes* _tmp5_; + GBytes* _tmp6_; +#line 171 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp1_ = context; -#line 154 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 171 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp2_ = camera; -#line 154 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 171 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp3_ = folder; -#line 154 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 171 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp4_ = filename; -#line 154 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp6_ = gp_load_file_into_buffer (_tmp1_, _tmp2_, _tmp3_, _tmp4_, GP_FILE_TYPE_PREVIEW, &_tmp5_, &_inner_error_); -#line 154 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp0_ = _tmp6_; -#line 154 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp0__length1 = _tmp5_; -#line 154 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - __tmp0__size_ = _tmp0__length1; -#line 154 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 171 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp5_ = gp_load_file_into_buffer (_tmp1_, _tmp2_, _tmp3_, _tmp4_, GP_FILE_TYPE_PREVIEW, &_inner_error_); +#line 171 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp0_ = _tmp5_; +#line 171 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" if (G_UNLIKELY (_inner_error_ != NULL)) { -#line 1414 "GPhoto.c" - goto __catch63_g_error; +#line 1485 "GPhoto.c" + goto __catch70_g_error; } -#line 154 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp7_ = _tmp0_; -#line 154 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp7__length1 = _tmp0__length1; -#line 154 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 171 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp6_ = _tmp0_; +#line 171 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp0_ = NULL; -#line 154 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp0__length1 = 0; -#line 154 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _vala_raw = (g_free (_vala_raw), NULL); -#line 154 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _vala_raw = _tmp7_; -#line 154 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _vala_raw_length1 = _tmp7__length1; -#line 153 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp0_ = (g_free (_tmp0_), NULL); -#line 1433 "GPhoto.c" +#line 171 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _g_bytes_unref0 (raw); +#line 171 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + raw = _tmp6_; +#line 170 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _g_bytes_unref0 (_tmp0_); +#line 1498 "GPhoto.c" } - goto __finally63; - __catch63_g_error: + goto __finally70; + __catch70_g_error: { PhotoMetadata* metadata = NULL; - Camera* _tmp8_; - GPContext* _tmp9_; + Camera* _tmp7_; + GPContext* _tmp8_; + const gchar* _tmp9_; const gchar* _tmp10_; - const gchar* _tmp11_; + PhotoMetadata* _tmp11_; PhotoMetadata* _tmp12_; PhotoMetadata* _tmp13_; - PhotoMetadata* _tmp14_; - guint _tmp15_; + guint _tmp14_; PhotoPreview* preview = NULL; + PhotoMetadata* _tmp15_; PhotoMetadata* _tmp16_; - PhotoMetadata* _tmp17_; - guint _tmp18_; - PhotoPreview* _tmp19_; - guint8* _tmp20_ = NULL; - PhotoPreview* _tmp21_; - gint _tmp22_; - guint8* _tmp23_; - gint _tmp20__length1; - gint __tmp20__size_; - guint8* _tmp24_; - gint _tmp24__length1; -#line 153 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + guint _tmp17_; + PhotoPreview* _tmp18_; + GBytes* _tmp19_ = NULL; + PhotoPreview* _tmp20_; + GBytes* _tmp21_; + GBytes* _tmp22_; + GBytes* _tmp23_; + gchar* _tmp24_; +#line 170 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_clear_error (&_inner_error_); -#line 153 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 170 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _inner_error_ = NULL; -#line 156 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp8_ = camera; -#line 156 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp9_ = context; -#line 156 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp10_ = folder; -#line 156 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp11_ = filename; -#line 156 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp12_ = gp_get_fallback_metadata (_tmp8_, _tmp9_, _tmp10_, _tmp11_); -#line 156 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - metadata = _tmp12_; -#line 157 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp13_ = metadata; -#line 157 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - if (NULL == _tmp13_) { -#line 158 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 173 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp7_ = camera; +#line 173 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp8_ = context; +#line 173 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp9_ = folder; +#line 173 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp10_ = filename; +#line 173 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp11_ = gp_get_fallback_metadata (_tmp7_, _tmp8_, _tmp9_, _tmp10_); +#line 173 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + metadata = _tmp11_; +#line 174 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp12_ = metadata; +#line 174 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + if (NULL == _tmp12_) { +#line 175 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" result = NULL; -#line 158 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 175 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _media_metadata_unref0 (metadata); -#line 158 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - if (raw) { -#line 158 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - *raw = _vala_raw; -#line 1488 "GPhoto.c" +#line 175 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _g_bytes_unref0 (out_bytes); +#line 175 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _g_bytes_unref0 (raw); +#line 175 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + if (preview_md5) { +#line 175 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + *preview_md5 = _vala_preview_md5; +#line 1555 "GPhoto.c" } else { -#line 158 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _vala_raw = (g_free (_vala_raw), NULL); -#line 1492 "GPhoto.c" - } -#line 158 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - if (raw_length1) { -#line 158 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - *raw_length1 = _vala_raw_length1; -#line 1498 "GPhoto.c" - } -#line 158 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - if (raw_length) { -#line 158 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - *raw_length = _vala_raw_length; -#line 1504 "GPhoto.c" +#line 175 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _g_free0 (_vala_preview_md5); +#line 1559 "GPhoto.c" } -#line 158 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 175 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" return result; -#line 1508 "GPhoto.c" +#line 1563 "GPhoto.c" } -#line 159 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp14_ = metadata; -#line 159 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp15_ = photo_metadata_get_preview_count (_tmp14_); -#line 159 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - if (((guint) 0) == _tmp15_) { -#line 160 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 176 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp13_ = metadata; +#line 176 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp14_ = photo_metadata_get_preview_count (_tmp13_); +#line 176 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + if (((guint) 0) == _tmp14_) { +#line 177 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" result = NULL; -#line 160 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 177 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _media_metadata_unref0 (metadata); -#line 160 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - if (raw) { -#line 160 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - *raw = _vala_raw; -#line 1524 "GPhoto.c" +#line 177 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _g_bytes_unref0 (out_bytes); +#line 177 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _g_bytes_unref0 (raw); +#line 177 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + if (preview_md5) { +#line 177 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + *preview_md5 = _vala_preview_md5; +#line 1583 "GPhoto.c" } else { -#line 160 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _vala_raw = (g_free (_vala_raw), NULL); -#line 1528 "GPhoto.c" - } -#line 160 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - if (raw_length1) { -#line 160 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - *raw_length1 = _vala_raw_length1; -#line 1534 "GPhoto.c" +#line 177 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _g_free0 (_vala_preview_md5); +#line 1587 "GPhoto.c" } -#line 160 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - if (raw_length) { -#line 160 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - *raw_length = _vala_raw_length; -#line 1540 "GPhoto.c" - } -#line 160 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 177 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" return result; -#line 1544 "GPhoto.c" +#line 1591 "GPhoto.c" } -#line 161 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 180 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp15_ = metadata; +#line 180 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp16_ = metadata; -#line 161 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp17_ = metadata; -#line 161 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp18_ = photo_metadata_get_preview_count (_tmp17_); -#line 161 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp19_ = photo_metadata_get_preview (_tmp16_, _tmp18_ - 1); -#line 161 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - preview = _tmp19_; -#line 162 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp21_ = preview; -#line 162 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp23_ = photo_preview_flatten (_tmp21_, &_tmp22_, &_inner_error_); -#line 162 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp20_ = _tmp23_; -#line 162 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp20__length1 = _tmp22_; -#line 162 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - __tmp20__size_ = _tmp20__length1; -#line 162 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 180 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp17_ = photo_metadata_get_preview_count (_tmp16_); +#line 180 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp18_ = photo_metadata_get_preview (_tmp15_, _tmp17_ - 1); +#line 180 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + preview = _tmp18_; +#line 181 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp20_ = preview; +#line 181 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp21_ = photo_preview_flatten (_tmp20_, &_inner_error_); +#line 181 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp19_ = _tmp21_; +#line 181 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" if (G_UNLIKELY (_inner_error_ != NULL)) { -#line 162 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 181 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _photo_preview_unref0 (preview); -#line 162 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 181 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _media_metadata_unref0 (metadata); -#line 1572 "GPhoto.c" - goto __finally63; +#line 1615 "GPhoto.c" + goto __finally70; } -#line 162 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp24_ = _tmp20_; -#line 162 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp24__length1 = _tmp20__length1; -#line 162 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp20_ = NULL; -#line 162 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp20__length1 = 0; -#line 162 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _vala_raw = (g_free (_vala_raw), NULL); -#line 162 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _vala_raw = _tmp24_; -#line 162 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _vala_raw_length1 = _tmp24__length1; -#line 153 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp20_ = (g_free (_tmp20_), NULL); -#line 153 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 181 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp22_ = _tmp19_; +#line 181 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp19_ = NULL; +#line 181 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _g_bytes_unref0 (raw); +#line 181 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + raw = _tmp22_; +#line 182 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp23_ = raw; +#line 182 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp24_ = g_compute_checksum_for_bytes (G_CHECKSUM_MD5, _tmp23_); +#line 182 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _g_free0 (_vala_preview_md5); +#line 182 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _vala_preview_md5 = _tmp24_; +#line 170 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _g_bytes_unref0 (_tmp19_); +#line 170 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _photo_preview_unref0 (preview); -#line 153 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 170 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _media_metadata_unref0 (metadata); -#line 1595 "GPhoto.c" +#line 1640 "GPhoto.c" } - __finally63: -#line 153 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + __finally70: +#line 170 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" if (G_UNLIKELY (_inner_error_ != NULL)) { -#line 153 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 170 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_propagate_error (error, _inner_error_); -#line 153 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - return NULL; -#line 1604 "GPhoto.c" - } -#line 165 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp25_ = _vala_raw; -#line 165 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp25__length1 = _vala_raw_length1; -#line 165 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - if (_tmp25_ == NULL) { -#line 166 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _vala_raw_length = (gsize) 0; -#line 167 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - result = NULL; -#line 167 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - if (raw) { -#line 167 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - *raw = _vala_raw; -#line 1620 "GPhoto.c" - } else { -#line 167 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _vala_raw = (g_free (_vala_raw), NULL); -#line 1624 "GPhoto.c" - } -#line 167 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - if (raw_length1) { -#line 167 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - *raw_length1 = _vala_raw_length1; -#line 1630 "GPhoto.c" - } -#line 167 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - if (raw_length) { -#line 167 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - *raw_length = _vala_raw_length; -#line 1636 "GPhoto.c" - } -#line 167 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - return result; -#line 1640 "GPhoto.c" - } #line 170 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp26_ = _vala_raw; + _g_bytes_unref0 (out_bytes); #line 170 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp26__length1 = _vala_raw_length1; + _g_bytes_unref0 (raw); #line 170 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _vala_raw_length = (gsize) _tmp26__length1; -#line 172 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp27_ = _vala_raw; -#line 172 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp27__length1 = _vala_raw_length1; -#line 172 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp28_ = (_tmp27_ != NULL) ? _vala_array_dup23 (_tmp27_, _tmp27__length1) : ((gpointer) _tmp27_); -#line 172 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp28__length1 = _tmp27__length1; -#line 172 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp29_ = (GMemoryInputStream*) g_memory_input_stream_new_from_data (_tmp28_, _tmp28__length1, NULL); -#line 172 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - mins = _tmp29_; -#line 173 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp31_ = mins; -#line 173 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp32_ = gdk_pixbuf_new_from_stream_at_scale (G_TYPE_CHECK_INSTANCE_CAST (_tmp31_, g_input_stream_get_type (), GInputStream), IMPORT_PREVIEW_MAX_SCALE, IMPORT_PREVIEW_MAX_SCALE, TRUE, NULL, &_inner_error_); -#line 173 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp30_ = _tmp32_; -#line 173 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + return NULL; +#line 1653 "GPhoto.c" + } +#line 185 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp25_ = raw; +#line 185 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp26_ = _g_bytes_ref0 (_tmp25_); +#line 185 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _g_bytes_unref0 (out_bytes); +#line 185 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + out_bytes = _tmp26_; +#line 186 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp27_ = out_bytes; +#line 186 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp28_ = g_compute_checksum_for_bytes (G_CHECKSUM_MD5, _tmp27_); +#line 186 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _g_free0 (_vala_preview_md5); +#line 186 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _vala_preview_md5 = _tmp28_; +#line 188 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp29_ = raw; +#line 188 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp30_ = (GMemoryInputStream*) g_memory_input_stream_new_from_bytes (_tmp29_); +#line 188 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + mins = _tmp30_; +#line 190 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp32_ = mins; +#line 190 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp33_ = gdk_pixbuf_new_from_stream_at_scale (G_TYPE_CHECK_INSTANCE_CAST (_tmp32_, g_input_stream_get_type (), GInputStream), IMPORT_PREVIEW_MAX_SCALE, IMPORT_PREVIEW_MAX_SCALE, TRUE, NULL, &_inner_error_); +#line 190 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp31_ = _tmp33_; +#line 190 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" if (G_UNLIKELY (_inner_error_ != NULL)) { -#line 173 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 190 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_propagate_error (error, _inner_error_); -#line 173 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 190 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _g_object_unref0 (mins); -#line 173 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 190 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _g_bytes_unref0 (out_bytes); +#line 190 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _g_bytes_unref0 (raw); +#line 190 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" return NULL; -#line 1674 "GPhoto.c" +#line 1695 "GPhoto.c" } -#line 173 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp33_ = _tmp30_; -#line 173 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp30_ = NULL; -#line 173 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - result = _tmp33_; -#line 173 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _g_object_unref0 (_tmp30_); -#line 173 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 190 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp34_ = _tmp31_; +#line 190 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp31_ = NULL; +#line 190 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + result = _tmp34_; +#line 190 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _g_object_unref0 (_tmp31_); +#line 190 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _g_object_unref0 (mins); -#line 173 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - if (raw) { -#line 173 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - *raw = _vala_raw; -#line 1690 "GPhoto.c" +#line 190 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _g_bytes_unref0 (out_bytes); +#line 190 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _g_bytes_unref0 (raw); +#line 190 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + if (preview_md5) { +#line 190 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + *preview_md5 = _vala_preview_md5; +#line 1715 "GPhoto.c" } else { -#line 173 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _vala_raw = (g_free (_vala_raw), NULL); -#line 1694 "GPhoto.c" +#line 190 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _g_free0 (_vala_preview_md5); +#line 1719 "GPhoto.c" } -#line 173 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - if (raw_length1) { -#line 173 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - *raw_length1 = _vala_raw_length1; -#line 1700 "GPhoto.c" - } -#line 173 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - if (raw_length) { -#line 173 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - *raw_length = _vala_raw_length; -#line 1706 "GPhoto.c" - } -#line 173 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 190 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" return result; -#line 1710 "GPhoto.c" +#line 1723 "GPhoto.c" } @@ -1724,75 +1737,75 @@ GdkPixbuf* gp_load_image (GPContext* context, Camera* camera, const gchar* folde GdkPixbuf* _tmp8_; GdkPixbuf* _tmp9_; GError * _inner_error_ = NULL; -#line 176 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 193 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_return_val_if_fail (context != NULL, NULL); -#line 176 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 193 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_return_val_if_fail (camera != NULL, NULL); -#line 176 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 193 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_return_val_if_fail (folder != NULL, NULL); -#line 176 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 193 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_return_val_if_fail (filename != NULL, NULL); -#line 178 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 195 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp0_ = context; -#line 178 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 195 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp1_ = camera; -#line 178 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 195 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp2_ = folder; -#line 178 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 195 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp3_ = filename; -#line 178 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 195 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp4_ = gp_load_file_into_stream (_tmp0_, _tmp1_, _tmp2_, _tmp3_, GP_FILE_TYPE_NORMAL, &_inner_error_); -#line 178 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 195 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" ins = _tmp4_; -#line 178 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 195 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" if (G_UNLIKELY (_inner_error_ != NULL)) { -#line 178 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 195 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_propagate_error (error, _inner_error_); -#line 178 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 195 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" return NULL; -#line 1754 "GPhoto.c" +#line 1767 "GPhoto.c" } -#line 179 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 196 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp5_ = ins; -#line 179 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 196 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" if (_tmp5_ == NULL) { -#line 180 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 197 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" result = NULL; -#line 180 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 197 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _g_object_unref0 (ins); -#line 180 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 197 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" return result; -#line 1766 "GPhoto.c" +#line 1779 "GPhoto.c" } -#line 182 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 199 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp7_ = ins; -#line 182 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 199 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp8_ = gdk_pixbuf_new_from_stream (_tmp7_, NULL, &_inner_error_); -#line 182 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 199 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp6_ = _tmp8_; -#line 182 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 199 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" if (G_UNLIKELY (_inner_error_ != NULL)) { -#line 182 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 199 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_propagate_error (error, _inner_error_); -#line 182 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 199 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _g_object_unref0 (ins); -#line 182 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 199 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" return NULL; -#line 1782 "GPhoto.c" +#line 1795 "GPhoto.c" } -#line 182 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 199 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp9_ = _tmp6_; -#line 182 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 199 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp6_ = NULL; -#line 182 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 199 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" result = _tmp9_; -#line 182 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 199 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _g_object_unref0 (_tmp6_); -#line 182 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 199 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _g_object_unref0 (ins); -#line 182 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 199 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" return result; -#line 1796 "GPhoto.c" +#line 1809 "GPhoto.c" } @@ -1818,351 +1831,327 @@ void gp_save_image (GPContext* context, Camera* camera, const gchar* folder, con int _tmp25_; int _tmp26_; GError * _inner_error_ = NULL; -#line 185 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 202 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_return_if_fail (context != NULL); -#line 185 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 202 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_return_if_fail (camera != NULL); -#line 185 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 202 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_return_if_fail (folder != NULL); -#line 185 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 202 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_return_if_fail (filename != NULL); -#line 185 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 202 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_return_if_fail (G_IS_FILE (dest_file)); -#line 186 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 203 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp0_ = dest_file; -#line 186 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 203 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp1_ = g_file_get_path (_tmp0_); -#line 186 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 203 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp2_ = _tmp1_; -#line 186 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 203 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp3_ = creat (_tmp2_, (mode_t) 0640); -#line 186 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 203 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp4_ = _tmp3_; -#line 186 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 203 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _g_free0 (_tmp2_); -#line 186 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 203 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" fd = _tmp4_; -#line 187 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 204 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp5_ = fd; -#line 187 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 204 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" if (_tmp5_ < 0) { -#line 1850 "GPhoto.c" +#line 1863 "GPhoto.c" gint _tmp6_; GFile* _tmp7_; gchar* _tmp8_; gchar* _tmp9_; GError* _tmp10_; GError* _tmp11_; -#line 188 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 205 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp6_ = errno; -#line 188 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 205 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp7_ = dest_file; -#line 188 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 205 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp8_ = g_file_get_path (_tmp7_); -#line 188 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 205 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp9_ = _tmp8_; -#line 188 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 205 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp10_ = g_error_new (G_IO_ERROR, G_IO_ERROR_FAILED, "[%d] Error creating file %s: %m", _tmp6_, _tmp9_); -#line 188 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 205 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp11_ = _tmp10_; -#line 188 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 205 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _g_free0 (_tmp9_); -#line 188 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 205 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _inner_error_ = _tmp11_; -#line 188 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 205 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_propagate_error (error, _inner_error_); -#line 188 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 205 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" return; -#line 1877 "GPhoto.c" +#line 1890 "GPhoto.c" } -#line 192 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 209 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp12_ = fd; -#line 192 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 209 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp14_ = gp_file_new_from_fd (&_tmp13_, _tmp12_); -#line 192 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 209 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _gp_file_unref0 (camera_file); -#line 192 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 209 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" camera_file = _tmp13_; -#line 192 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 209 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" res = _tmp14_; -#line 193 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 210 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp15_ = res; -#line 193 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 210 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" if (_tmp15_ != GP_OK) { -#line 1893 "GPhoto.c" +#line 1906 "GPhoto.c" int _tmp16_; int _tmp17_; const gchar* _tmp18_; GError* _tmp19_; -#line 194 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 211 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp16_ = res; -#line 194 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 211 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp17_ = res; -#line 194 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 211 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp18_ = gp_port_result_as_string (_tmp17_); -#line 194 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 211 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp19_ = g_error_new (GPHOTO_ERROR, GPHOTO_ERROR_LIBRARY, "[%d] Error allocating camera file: %s", (gint) _tmp16_, _tmp18_); -#line 194 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 211 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _inner_error_ = _tmp19_; -#line 194 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 211 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_propagate_error (error, _inner_error_); -#line 194 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 211 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _gp_file_unref0 (camera_file); -#line 194 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 211 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" return; -#line 1914 "GPhoto.c" +#line 1927 "GPhoto.c" } -#line 197 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 214 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp20_ = camera; -#line 197 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 214 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp21_ = folder; -#line 197 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 214 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp22_ = filename; -#line 197 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 214 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp23_ = camera_file; -#line 197 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 214 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp24_ = context; -#line 197 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 214 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp25_ = gp_camera_file_get (_tmp20_, _tmp21_, _tmp22_, GP_FILE_TYPE_NORMAL, _tmp23_, _tmp24_); -#line 197 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 214 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" res = _tmp25_; -#line 198 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 215 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp26_ = res; -#line 198 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 215 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" if (_tmp26_ != GP_OK) { -#line 1934 "GPhoto.c" +#line 1947 "GPhoto.c" int _tmp27_; const gchar* _tmp28_; const gchar* _tmp29_; int _tmp30_; const gchar* _tmp31_; GError* _tmp32_; -#line 199 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 216 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp27_ = res; -#line 199 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 216 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp28_ = folder; -#line 199 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 216 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp29_ = filename; -#line 199 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 216 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp30_ = res; -#line 199 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 216 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp31_ = gp_port_result_as_string (_tmp30_); -#line 199 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 216 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp32_ = g_error_new (GPHOTO_ERROR, GPHOTO_ERROR_LIBRARY, "[%d] Error retrieving file object for %s/%s: %s", (gint) _tmp27_, _tmp28_, _tmp29_, _tmp31_); -#line 199 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 216 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _inner_error_ = _tmp32_; -#line 199 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 216 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_propagate_error (error, _inner_error_); -#line 199 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 216 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _gp_file_unref0 (camera_file); -#line 199 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 216 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" return; -#line 1961 "GPhoto.c" +#line 1974 "GPhoto.c" } -#line 185 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 202 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _gp_file_unref0 (camera_file); -#line 1965 "GPhoto.c" +#line 1978 "GPhoto.c" +} + + +static gint _vala_g_bytes_get_length (GBytes* self) { + gint result; + gsize _tmp0_; +#line 5013 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + g_return_val_if_fail (self != NULL, 0); +#line 5015 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp0_ = g_bytes_get_size (self); +#line 5015 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + result = (gint) _tmp0_; +#line 5015 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + return result; +#line 1993 "GPhoto.c" } PhotoMetadata* gp_load_metadata (GPContext* context, Camera* camera, const gchar* folder, const gchar* filename, GError** error) { PhotoMetadata* result = NULL; - guint8* camera_raw = NULL; - gint camera_raw_length1; - gint _camera_raw_size_; - gboolean _tmp13_ = FALSE; - guint8* _tmp14_; - gint _tmp14__length1; + GBytes* camera_raw = NULL; + gboolean _tmp12_ = FALSE; + GBytes* _tmp13_; PhotoMetadata* metadata = NULL; - PhotoMetadata* _tmp16_; PhotoMetadata* _tmp17_; - guint8* _tmp18_; - gint _tmp18__length1; + PhotoMetadata* _tmp18_; + GBytes* _tmp19_; GError * _inner_error_ = NULL; -#line 204 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 221 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_return_val_if_fail (context != NULL, NULL); -#line 204 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 221 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_return_val_if_fail (camera != NULL, NULL); -#line 204 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 221 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_return_val_if_fail (folder != NULL, NULL); -#line 204 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 221 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_return_val_if_fail (filename != NULL, NULL); -#line 206 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 223 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" camera_raw = NULL; -#line 206 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - camera_raw_length1 = 0; -#line 206 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _camera_raw_size_ = camera_raw_length1; -#line 1997 "GPhoto.c" +#line 2017 "GPhoto.c" { - guint8* _tmp0_ = NULL; + GBytes* _tmp0_ = NULL; GPContext* _tmp1_; Camera* _tmp2_; const gchar* _tmp3_; const gchar* _tmp4_; - gint _tmp5_; - guint8* _tmp6_; - gint _tmp0__length1; - gint __tmp0__size_; - guint8* _tmp7_; - gint _tmp7__length1; -#line 208 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + GBytes* _tmp5_; + GBytes* _tmp6_; +#line 225 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp1_ = context; -#line 208 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 225 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp2_ = camera; -#line 208 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 225 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp3_ = folder; -#line 208 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 225 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp4_ = filename; -#line 208 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp6_ = gp_load_file_into_buffer (_tmp1_, _tmp2_, _tmp3_, _tmp4_, GP_FILE_TYPE_EXIF, &_tmp5_, &_inner_error_); -#line 208 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp0_ = _tmp6_; -#line 208 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp0__length1 = _tmp5_; -#line 208 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - __tmp0__size_ = _tmp0__length1; -#line 208 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 225 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp5_ = gp_load_file_into_buffer (_tmp1_, _tmp2_, _tmp3_, _tmp4_, GP_FILE_TYPE_EXIF, &_inner_error_); +#line 225 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp0_ = _tmp5_; +#line 225 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" if (G_UNLIKELY (_inner_error_ != NULL)) { -#line 2028 "GPhoto.c" - goto __catch64_g_error; +#line 2040 "GPhoto.c" + goto __catch71_g_error; } -#line 208 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp7_ = _tmp0_; -#line 208 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp7__length1 = _tmp0__length1; -#line 208 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 225 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp6_ = _tmp0_; +#line 225 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp0_ = NULL; -#line 208 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp0__length1 = 0; -#line 208 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - camera_raw = (g_free (camera_raw), NULL); -#line 208 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - camera_raw = _tmp7_; -#line 208 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - camera_raw_length1 = _tmp7__length1; -#line 208 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _camera_raw_size_ = camera_raw_length1; -#line 207 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp0_ = (g_free (_tmp0_), NULL); -#line 2049 "GPhoto.c" +#line 225 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _g_bytes_unref0 (camera_raw); +#line 225 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + camera_raw = _tmp6_; +#line 224 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _g_bytes_unref0 (_tmp0_); +#line 2053 "GPhoto.c" } - goto __finally64; - __catch64_g_error: + goto __finally71; + __catch71_g_error: { - Camera* _tmp8_; - GPContext* _tmp9_; + Camera* _tmp7_; + GPContext* _tmp8_; + const gchar* _tmp9_; const gchar* _tmp10_; - const gchar* _tmp11_; - PhotoMetadata* _tmp12_; -#line 207 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + PhotoMetadata* _tmp11_; +#line 224 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_clear_error (&_inner_error_); -#line 207 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 224 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _inner_error_ = NULL; -#line 210 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp8_ = camera; -#line 210 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp9_ = context; -#line 210 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp10_ = folder; -#line 210 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp11_ = filename; -#line 210 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp12_ = gp_get_fallback_metadata (_tmp8_, _tmp9_, _tmp10_, _tmp11_); -#line 210 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - result = _tmp12_; -#line 210 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - camera_raw = (g_free (camera_raw), NULL); -#line 210 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 227 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp7_ = camera; +#line 227 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp8_ = context; +#line 227 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp9_ = folder; +#line 227 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp10_ = filename; +#line 227 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp11_ = gp_get_fallback_metadata (_tmp7_, _tmp8_, _tmp9_, _tmp10_); +#line 227 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + result = _tmp11_; +#line 227 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _g_bytes_unref0 (camera_raw); +#line 227 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" return result; -#line 2079 "GPhoto.c" +#line 2083 "GPhoto.c" } - __finally64: -#line 207 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + __finally71: +#line 224 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" if (G_UNLIKELY (_inner_error_ != NULL)) { -#line 207 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 224 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_propagate_error (error, _inner_error_); -#line 207 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - camera_raw = (g_free (camera_raw), NULL); -#line 207 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 224 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _g_bytes_unref0 (camera_raw); +#line 224 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" return NULL; -#line 2090 "GPhoto.c" +#line 2094 "GPhoto.c" } -#line 213 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp14_ = camera_raw; -#line 213 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp14__length1 = camera_raw_length1; -#line 213 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - if (_tmp14_ == NULL) { -#line 213 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp13_ = TRUE; -#line 2100 "GPhoto.c" +#line 230 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp13_ = camera_raw; +#line 230 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + if (_tmp13_ == NULL) { +#line 230 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp12_ = TRUE; +#line 2102 "GPhoto.c" } else { - guint8* _tmp15_; - gint _tmp15__length1; -#line 213 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp15_ = camera_raw; -#line 213 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp15__length1 = camera_raw_length1; -#line 213 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp13_ = _tmp15__length1 == 0; -#line 2110 "GPhoto.c" + GBytes* _tmp14_; + gint _tmp15_; + gint _tmp16_; +#line 230 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp14_ = camera_raw; +#line 230 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp15_ = _vala_g_bytes_get_length (_tmp14_); +#line 230 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp16_ = _tmp15_; +#line 230 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp12_ = _tmp16_ == 0; +#line 2115 "GPhoto.c" } -#line 213 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - if (_tmp13_) { -#line 214 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 230 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + if (_tmp12_) { +#line 231 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" result = NULL; -#line 214 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - camera_raw = (g_free (camera_raw), NULL); -#line 214 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 231 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _g_bytes_unref0 (camera_raw); +#line 231 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" return result; -#line 2120 "GPhoto.c" +#line 2125 "GPhoto.c" } -#line 216 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp16_ = photo_metadata_new (); -#line 216 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - metadata = _tmp16_; -#line 217 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp17_ = metadata; -#line 217 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp18_ = camera_raw; -#line 217 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp18__length1 = camera_raw_length1; -#line 217 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - photo_metadata_read_from_app1_segment (_tmp17_, _tmp18_, _tmp18__length1, 0, &_inner_error_); -#line 217 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 233 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp17_ = photo_metadata_new (); +#line 233 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + metadata = _tmp17_; +#line 234 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp18_ = metadata; +#line 234 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp19_ = camera_raw; +#line 234 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + photo_metadata_read_from_app1_segment (_tmp18_, _tmp19_, &_inner_error_); +#line 234 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" if (G_UNLIKELY (_inner_error_ != NULL)) { -#line 217 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 234 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_propagate_error (error, _inner_error_); -#line 217 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 234 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _media_metadata_unref0 (metadata); -#line 217 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - camera_raw = (g_free (camera_raw), NULL); -#line 217 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 234 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _g_bytes_unref0 (camera_raw); +#line 234 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" return NULL; -#line 2144 "GPhoto.c" +#line 2147 "GPhoto.c" } -#line 219 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 236 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" result = metadata; -#line 219 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - camera_raw = (g_free (camera_raw), NULL); -#line 219 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 236 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _g_bytes_unref0 (camera_raw); +#line 236 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" return result; -#line 2152 "GPhoto.c" -} - - -static guint8* _vala_array_dup24 (guint8* self, int length) { -#line 246 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - return g_memdup (self, length * sizeof (guint8)); -#line 2159 "GPhoto.c" -} - - -static void _gp_on_mins_destroyed_gdestroy_notify (void* data) { -#line 246 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - gp_on_mins_destroyed (data); -#line 2166 "GPhoto.c" +#line 2155 "GPhoto.c" } @@ -2180,308 +2169,259 @@ GInputStream* gp_load_file_into_stream (GPContext* context, Camera* camera, cons GPContext* _tmp11_; int _tmp12_; int _tmp13_; - guint8* data = NULL; - gulong data_len = 0UL; - guint8* _tmp20_ = NULL; - gulong _tmp21_ = 0UL; - int _tmp22_; - int _tmp23_; + GBytes* bytes = NULL; + GPContext* _tmp20_; + GBytes* _tmp21_; + GBytes* _tmp22_; GFile* temp = NULL; - GFile* _tmp32_; - GFile* _tmp33_; - GFile* _tmp34_; - GFile* _tmp35_; - GFile* _tmp36_; - gchar* _tmp37_; - gchar* _tmp38_; - int _tmp39_; - int _tmp40_; - GFileInputStream* _tmp51_ = NULL; - GFile* _tmp52_; - GFileInputStream* _tmp53_; - GFileInputStream* _tmp54_; + GFile* _tmp25_; + GFile* _tmp26_; + GFile* _tmp27_; + GFile* _tmp28_; + GFile* _tmp29_; + gchar* _tmp30_; + gchar* _tmp31_; + int _tmp32_; + int _tmp33_; + GFileInputStream* _tmp44_ = NULL; + GFile* _tmp45_; + GFileInputStream* _tmp46_; + GFileInputStream* _tmp47_; GError * _inner_error_ = NULL; -#line 224 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 241 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_return_val_if_fail (context != NULL, NULL); -#line 224 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 241 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_return_val_if_fail (camera != NULL, NULL); -#line 224 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 241 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_return_val_if_fail (folder != NULL, NULL); -#line 224 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 241 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_return_val_if_fail (filename != NULL, NULL); -#line 227 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 244 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp1_ = gp_file_new (&_tmp0_); -#line 227 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 244 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _gp_file_unref0 (camera_file); -#line 227 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 244 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" camera_file = _tmp0_; -#line 227 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 244 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" res = _tmp1_; -#line 228 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 245 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp2_ = res; -#line 228 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 245 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" if (_tmp2_ != GP_OK) { -#line 2225 "GPhoto.c" +#line 2212 "GPhoto.c" int _tmp3_; int _tmp4_; const gchar* _tmp5_; GError* _tmp6_; -#line 229 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 246 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp3_ = res; -#line 229 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 246 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp4_ = res; -#line 229 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 246 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp5_ = gp_port_result_as_string (_tmp4_); -#line 229 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 246 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp6_ = g_error_new (GPHOTO_ERROR, GPHOTO_ERROR_LIBRARY, "[%d] Error allocating camera file: %s", (gint) _tmp3_, _tmp5_); -#line 229 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 246 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _inner_error_ = _tmp6_; -#line 229 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 246 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_propagate_error (error, _inner_error_); -#line 229 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 246 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _gp_file_unref0 (camera_file); -#line 229 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 246 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" return NULL; -#line 2246 "GPhoto.c" +#line 2233 "GPhoto.c" } -#line 231 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 248 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp7_ = camera; -#line 231 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 248 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp8_ = folder; -#line 231 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 248 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp9_ = filename; -#line 231 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 248 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp10_ = filetype; -#line 231 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 248 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp11_ = context; -#line 231 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 248 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp12_ = gp_camera_file_get (_tmp7_, _tmp8_, _tmp9_, _tmp10_, camera_file, _tmp11_); -#line 231 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 248 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" res = _tmp12_; -#line 232 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 249 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp13_ = res; -#line 232 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 249 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" if (_tmp13_ != GP_OK) { -#line 2266 "GPhoto.c" +#line 2253 "GPhoto.c" int _tmp14_; const gchar* _tmp15_; const gchar* _tmp16_; int _tmp17_; const gchar* _tmp18_; GError* _tmp19_; -#line 233 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 250 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp14_ = res; -#line 233 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 250 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp15_ = folder; -#line 233 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 250 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp16_ = filename; -#line 233 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 250 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp17_ = res; -#line 233 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 250 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp18_ = gp_port_result_as_string (_tmp17_); -#line 233 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 250 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp19_ = g_error_new (GPHOTO_ERROR, GPHOTO_ERROR_LIBRARY, "[%d] Error retrieving file object for %s/%s: %s", (gint) _tmp14_, _tmp15_, _tmp16_, _tmp18_); -#line 233 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 250 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _inner_error_ = _tmp19_; -#line 233 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 250 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_propagate_error (error, _inner_error_); -#line 233 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 250 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _gp_file_unref0 (camera_file); -#line 233 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 250 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" return NULL; -#line 2293 "GPhoto.c" +#line 2280 "GPhoto.c" } -#line 241 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp22_ = gp_file_get_data_and_size (camera_file, &_tmp20_, &_tmp21_); -#line 241 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - data = _tmp20_; -#line 241 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - data_len = _tmp21_; -#line 241 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - res = _tmp22_; -#line 242 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp23_ = res; -#line 242 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - if (_tmp23_ == GP_OK) { -#line 2307 "GPhoto.c" - guint8* buffer = NULL; - gulong _tmp24_; - guint8* _tmp25_; - gint buffer_length1; - gint _buffer_size_; - guint8* _tmp26_; - gint _tmp26__length1; - guint8* _tmp27_; - guint8* _tmp28_; - gint _tmp28__length1; - guint8* _tmp29_; - gint _tmp29__length1; - guint8* _tmp30_; - gint _tmp30__length1; - GMemoryInputStream* _tmp31_; -#line 243 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp24_ = data_len; -#line 243 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp25_ = g_new0 (guint8, _tmp24_); -#line 243 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - buffer = _tmp25_; -#line 243 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - buffer_length1 = _tmp24_; -#line 243 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _buffer_size_ = buffer_length1; -#line 244 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp26_ = buffer; -#line 244 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp26__length1 = buffer_length1; -#line 244 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp27_ = data; -#line 244 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp28_ = buffer; -#line 244 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp28__length1 = buffer_length1; -#line 244 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - memcpy (_tmp26_, _tmp27_, (gsize) _tmp28__length1); -#line 246 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp29_ = buffer; -#line 246 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp29__length1 = buffer_length1; -#line 246 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp30_ = (_tmp29_ != NULL) ? _vala_array_dup24 (_tmp29_, _tmp29__length1) : ((gpointer) _tmp29_); -#line 246 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp30__length1 = _tmp29__length1; -#line 246 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp31_ = (GMemoryInputStream*) g_memory_input_stream_new_from_data (_tmp30_, _tmp30__length1, _gp_on_mins_destroyed_gdestroy_notify); -#line 246 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - result = G_TYPE_CHECK_INSTANCE_CAST (_tmp31_, g_input_stream_get_type (), GInputStream); -#line 246 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - buffer = (g_free (buffer), NULL); -#line 246 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 256 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp20_ = context; +#line 256 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp21_ = gp_camera_file_to_bytes (_tmp20_, camera_file); +#line 256 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + bytes = _tmp21_; +#line 257 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp22_ = bytes; +#line 257 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + if (_tmp22_ != NULL) { +#line 2292 "GPhoto.c" + GBytes* _tmp23_; + GMemoryInputStream* _tmp24_; +#line 258 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp23_ = bytes; +#line 258 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp24_ = (GMemoryInputStream*) g_memory_input_stream_new_from_bytes (_tmp23_); +#line 258 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + result = G_TYPE_CHECK_INSTANCE_CAST (_tmp24_, g_input_stream_get_type (), GInputStream); +#line 258 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _g_bytes_unref0 (bytes); +#line 258 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _gp_file_unref0 (camera_file); -#line 246 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 258 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" return result; -#line 2363 "GPhoto.c" +#line 2307 "GPhoto.c" } -#line 250 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp32_ = app_dirs_get_temp_dir (); -#line 250 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp33_ = _tmp32_; -#line 250 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp34_ = g_file_get_child (_tmp33_, "import.tmp"); -#line 250 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp35_ = _tmp34_; -#line 250 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _g_object_unref0 (_tmp33_); -#line 250 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - temp = _tmp35_; -#line 251 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp36_ = temp; -#line 251 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp37_ = g_file_get_path (_tmp36_); -#line 251 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp38_ = _tmp37_; -#line 251 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp39_ = gp_file_save (camera_file, _tmp38_); -#line 251 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - res = _tmp39_; -#line 251 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _g_free0 (_tmp38_); -#line 252 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp40_ = res; -#line 252 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - if (_tmp40_ != GP_OK) { -#line 2393 "GPhoto.c" - int _tmp41_; - const gchar* _tmp42_; - const gchar* _tmp43_; - GFile* _tmp44_; - gchar* _tmp45_; - gchar* _tmp46_; - int _tmp47_; - const gchar* _tmp48_; - GError* _tmp49_; - GError* _tmp50_; -#line 253 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp41_ = res; -#line 253 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp42_ = folder; -#line 253 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp43_ = filename; -#line 253 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp44_ = temp; -#line 253 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp45_ = g_file_get_path (_tmp44_); -#line 253 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp46_ = _tmp45_; -#line 253 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp47_ = res; -#line 253 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp48_ = gp_port_result_as_string (_tmp47_); -#line 253 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp49_ = g_error_new (GPHOTO_ERROR, GPHOTO_ERROR_LIBRARY, "[%d] Error copying file %s/%s to %s: %s", (gint) _tmp41_, _tmp42_, _tmp43_, _tmp46_, _tmp48_); -#line 253 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp50_ = _tmp49_; -#line 253 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _g_free0 (_tmp46_); -#line 253 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _inner_error_ = _tmp50_; -#line 253 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 262 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp25_ = app_dirs_get_temp_dir (); +#line 262 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp26_ = _tmp25_; +#line 262 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp27_ = g_file_get_child (_tmp26_, "import.tmp"); +#line 262 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp28_ = _tmp27_; +#line 262 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _g_object_unref0 (_tmp26_); +#line 262 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + temp = _tmp28_; +#line 263 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp29_ = temp; +#line 263 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp30_ = g_file_get_path (_tmp29_); +#line 263 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp31_ = _tmp30_; +#line 263 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp32_ = gp_file_save (camera_file, _tmp31_); +#line 263 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + res = _tmp32_; +#line 263 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _g_free0 (_tmp31_); +#line 264 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp33_ = res; +#line 264 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + if (_tmp33_ != GP_OK) { +#line 2337 "GPhoto.c" + int _tmp34_; + const gchar* _tmp35_; + const gchar* _tmp36_; + GFile* _tmp37_; + gchar* _tmp38_; + gchar* _tmp39_; + int _tmp40_; + const gchar* _tmp41_; + GError* _tmp42_; + GError* _tmp43_; +#line 265 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp34_ = res; +#line 265 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp35_ = folder; +#line 265 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp36_ = filename; +#line 265 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp37_ = temp; +#line 265 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp38_ = g_file_get_path (_tmp37_); +#line 265 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp39_ = _tmp38_; +#line 265 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp40_ = res; +#line 265 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp41_ = gp_port_result_as_string (_tmp40_); +#line 265 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp42_ = g_error_new (GPHOTO_ERROR, GPHOTO_ERROR_LIBRARY, "[%d] Error copying file %s/%s to %s: %s", (gint) _tmp34_, _tmp35_, _tmp36_, _tmp39_, _tmp41_); +#line 265 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp43_ = _tmp42_; +#line 265 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _g_free0 (_tmp39_); +#line 265 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _inner_error_ = _tmp43_; +#line 265 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_propagate_error (error, _inner_error_); -#line 253 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 265 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _g_object_unref0 (temp); -#line 253 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 265 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _g_bytes_unref0 (bytes); +#line 265 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _gp_file_unref0 (camera_file); -#line 253 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 265 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" return NULL; -#line 2436 "GPhoto.c" +#line 2382 "GPhoto.c" } -#line 256 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp52_ = temp; -#line 256 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp53_ = g_file_read (_tmp52_, NULL, &_inner_error_); -#line 256 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp51_ = _tmp53_; -#line 256 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 268 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp45_ = temp; +#line 268 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp46_ = g_file_read (_tmp45_, NULL, &_inner_error_); +#line 268 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp44_ = _tmp46_; +#line 268 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" if (G_UNLIKELY (_inner_error_ != NULL)) { -#line 256 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 268 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_propagate_error (error, _inner_error_); -#line 256 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 268 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _g_object_unref0 (temp); -#line 256 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 268 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _g_bytes_unref0 (bytes); +#line 268 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _gp_file_unref0 (camera_file); -#line 256 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 268 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" return NULL; -#line 2454 "GPhoto.c" +#line 2402 "GPhoto.c" } -#line 256 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp54_ = _tmp51_; -#line 256 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp51_ = NULL; -#line 256 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - result = G_TYPE_CHECK_INSTANCE_CAST (_tmp54_, g_input_stream_get_type (), GInputStream); -#line 256 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _g_object_unref0 (_tmp51_); -#line 256 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 268 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp47_ = _tmp44_; +#line 268 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _tmp44_ = NULL; +#line 268 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + result = G_TYPE_CHECK_INSTANCE_CAST (_tmp47_, g_input_stream_get_type (), GInputStream); +#line 268 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _g_object_unref0 (_tmp44_); +#line 268 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _g_object_unref0 (temp); -#line 256 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 268 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + _g_bytes_unref0 (bytes); +#line 268 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _gp_file_unref0 (camera_file); -#line 256 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 268 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" return result; -#line 2470 "GPhoto.c" +#line 2420 "GPhoto.c" } -void gp_on_mins_destroyed (void* data) { - void* _tmp0_; -#line 260 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp0_ = data; -#line 260 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - g_free (_tmp0_); -#line 2480 "GPhoto.c" -} - - -guint8* gp_load_file_into_buffer (GPContext* context, Camera* camera, const gchar* folder, const gchar* filename, CameraFileType filetype, int* result_length1, GError** error) { - guint8* result = NULL; +GBytes* gp_load_file_into_buffer (GPContext* context, Camera* camera, const gchar* folder, const gchar* filename, CameraFileType filetype, GError** error) { + GBytes* result = NULL; CameraFile* camera_file = NULL; int res = 0; CameraFile* _tmp0_ = NULL; @@ -2495,192 +2435,115 @@ guint8* gp_load_file_into_buffer (GPContext* context, Camera* camera, const gcha GPContext* _tmp12_; int _tmp13_; int _tmp14_; - guint8* data = NULL; - gulong data_len = 0UL; - CameraFile* _tmp21_; - guint8* _tmp22_ = NULL; - gulong _tmp23_ = 0UL; - int _tmp24_; - int _tmp25_; - guint8* buffer = NULL; - gulong _tmp27_; - guint8* _tmp28_; - gint buffer_length1; - gint _buffer_size_; - guint8* _tmp29_; - gint _tmp29__length1; - guint8* _tmp30_; - guint8* _tmp31_; - gint _tmp31__length1; - guint8* _tmp32_; - gint _tmp32__length1; + GPContext* _tmp21_; + CameraFile* _tmp22_; + GBytes* _tmp23_; GError * _inner_error_ = NULL; -#line 264 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 272 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_return_val_if_fail (context != NULL, NULL); -#line 264 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 272 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_return_val_if_fail (camera != NULL, NULL); -#line 264 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 272 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_return_val_if_fail (folder != NULL, NULL); -#line 264 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 272 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_return_val_if_fail (filename != NULL, NULL); -#line 267 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 275 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp1_ = gp_file_new (&_tmp0_); -#line 267 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 275 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _gp_file_unref0 (camera_file); -#line 267 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 275 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" camera_file = _tmp0_; -#line 267 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 275 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" res = _tmp1_; -#line 268 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 276 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp2_ = res; -#line 268 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 276 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" if (_tmp2_ != GP_OK) { -#line 2539 "GPhoto.c" +#line 2463 "GPhoto.c" int _tmp3_; int _tmp4_; const gchar* _tmp5_; GError* _tmp6_; -#line 269 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 277 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp3_ = res; -#line 269 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 277 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp4_ = res; -#line 269 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 277 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp5_ = gp_port_result_as_string (_tmp4_); -#line 269 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 277 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp6_ = g_error_new (GPHOTO_ERROR, GPHOTO_ERROR_LIBRARY, "[%d] Error allocating camera file: %s", (gint) _tmp3_, _tmp5_); -#line 269 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 277 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _inner_error_ = _tmp6_; -#line 269 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 277 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" g_propagate_error (error, _inner_error_); -#line 269 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 277 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _gp_file_unref0 (camera_file); -#line 269 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 277 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" return NULL; -#line 2560 "GPhoto.c" +#line 2484 "GPhoto.c" } -#line 271 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 279 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp7_ = camera; -#line 271 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 279 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp8_ = folder; -#line 271 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 279 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp9_ = filename; -#line 271 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 279 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp10_ = filetype; -#line 271 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 279 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp11_ = camera_file; -#line 271 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 279 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp12_ = context; -#line 271 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 279 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp13_ = gp_camera_file_get (_tmp7_, _tmp8_, _tmp9_, _tmp10_, _tmp11_, _tmp12_); -#line 271 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 279 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" res = _tmp13_; -#line 272 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 280 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp14_ = res; -#line 272 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 280 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" if (_tmp14_ != GP_OK) { -#line 2582 "GPhoto.c" +#line 2506 "GPhoto.c" int _tmp15_; const gchar* _tmp16_; const gchar* _tmp17_; int _tmp18_; const gchar* _tmp19_; GError* _tmp20_; -#line 273 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 281 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp15_ = res; -#line 273 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 281 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp16_ = folder; -#line 273 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 281 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp17_ = filename; -#line 273 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 281 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp18_ = res; -#line 273 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 281 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp19_ = gp_port_result_as_string (_tmp18_); -#line 273 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 281 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _tmp20_ = g_error_new (GPHOTO_ERROR, GPHOTO_ERROR_LIBRARY, "[%d] Error retrieving file object for %s/%s: %s", (gint) _tmp15_, _tmp16_, _tmp17_, _tmp19_); -#line 273 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 281 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _inner_error_ = _tmp20_; -#line 273 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - g_propagate_error (error, _inner_error_); -#line 273 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _gp_file_unref0 (camera_file); -#line 273 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - return NULL; -#line 2609 "GPhoto.c" - } -#line 280 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp21_ = camera_file; -#line 280 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp24_ = gp_file_get_data_and_size (_tmp21_, &_tmp22_, &_tmp23_); -#line 280 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - data = _tmp22_; -#line 280 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - data_len = _tmp23_; -#line 280 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - res = _tmp24_; #line 281 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp25_ = res; + g_propagate_error (error, _inner_error_); #line 281 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - if (_tmp25_ != GP_OK) { -#line 2625 "GPhoto.c" - guint8* _tmp26_; - gint _tmp26__length1; -#line 282 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp26_ = NULL; -#line 282 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp26__length1 = 0; -#line 282 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - if (result_length1) { -#line 282 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - *result_length1 = _tmp26__length1; -#line 2636 "GPhoto.c" - } -#line 282 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - result = _tmp26_; -#line 282 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _gp_file_unref0 (camera_file); -#line 282 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - return result; -#line 2644 "GPhoto.c" +#line 281 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" + return NULL; +#line 2533 "GPhoto.c" } #line 284 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp27_ = data_len; + _tmp21_ = context; #line 284 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp28_ = g_new0 (guint8, _tmp27_); + _tmp22_ = camera_file; #line 284 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - buffer = _tmp28_; + _tmp23_ = gp_camera_file_to_bytes (_tmp21_, _tmp22_); #line 284 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - buffer_length1 = _tmp27_; + result = _tmp23_; #line 284 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _buffer_size_ = buffer_length1; -#line 285 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp29_ = buffer; -#line 285 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp29__length1 = buffer_length1; -#line 285 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp30_ = data; -#line 285 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp31_ = buffer; -#line 285 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp31__length1 = buffer_length1; -#line 285 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - memcpy (_tmp29_, _tmp30_, (gsize) _tmp31__length1); -#line 287 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp32_ = buffer; -#line 287 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - _tmp32__length1 = buffer_length1; -#line 287 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - if (result_length1) { -#line 287 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - *result_length1 = _tmp32__length1; -#line 2676 "GPhoto.c" - } -#line 287 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" - result = _tmp32_; -#line 287 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" _gp_file_unref0 (camera_file); -#line 287 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" +#line 284 "/home/jens/Source/shotwell/src/camera/GPhoto.vala" return result; -#line 2684 "GPhoto.c" +#line 2547 "GPhoto.c" } |