diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2018-05-01 14:43:08 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2018-05-01 14:43:08 +0200 |
commit | 2b3f22361da0c1d8e6ce70d71352821758186db7 (patch) | |
tree | 5d10633b47369b3aa52a05bf889ede0dbe5ee108 /src/graphics-processor.c | |
parent | 211da5fc3048ca2b6ccee2166b0aaaade55cb84f (diff) | |
parent | dc6c76eb04dfe3d4262a1806808f0bc0bf523238 (diff) |
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'src/graphics-processor.c')
-rw-r--r-- | src/graphics-processor.c | 1237 |
1 files changed, 1237 insertions, 0 deletions
diff --git a/src/graphics-processor.c b/src/graphics-processor.c new file mode 100644 index 0000000..d0ce76a --- /dev/null +++ b/src/graphics-processor.c @@ -0,0 +1,1237 @@ +/* graphics-processor.c generated by valac 0.36.6, the Vala compiler + * generated from graphics-processor.vala, do not modify */ + + +#include <glib.h> +#include <glib-object.h> +#include <stdlib.h> +#include <string.h> +#include <gee.h> +#include "shotwell-graphics-processor.h" +#include <gdk-pixbuf/gdk-pixbuf.h> +#include <float.h> +#include <math.h> +#include <gio/gio.h> + +#define _g_free0(var) (var = (g_free (var), NULL)) +#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL))) +#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL))) +#define _g_key_file_unref0(var) ((var == NULL) ? NULL : (var = (g_key_file_unref (var), NULL))) +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) +#define _key_value_map_unref0(var) ((var == NULL) ? NULL : (var = (key_value_map_unref (var), NULL))) +#define _g_option_context_free0(var) ((var == NULL) ? NULL : (var = (g_option_context_free (var), NULL))) +#define _pixel_transformation_bundle_unref0(var) ((var == NULL) ? NULL : (var = (pixel_transformation_bundle_unref (var), NULL))) +#define _g_timer_destroy0(var) ((var == NULL) ? NULL : (var = (g_timer_destroy (var), NULL))) +#define _pixel_transformer_unref0(var) ((var == NULL) ? NULL : (var = (pixel_transformer_unref (var), NULL))) + + +extern gchar* input_file; +gchar* input_file = NULL; +extern gchar* output_file; +gchar* output_file = NULL; +extern gchar* pipeline; +gchar* pipeline = NULL; +extern gboolean auto_enhance; +gboolean auto_enhance = FALSE; +extern gchar* format; +gchar* format = NULL; +extern gint jobs; +gint jobs = -1; + +GeeHashMap* marshall_all_transformations (const gchar* filename); +gint _vala_main (gchar** args, int args_length1); +static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func); +static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func); + +const GOptionEntry options[7] = {{"input", 'i', 0, G_OPTION_ARG_FILENAME, &input_file, "FILE to process", "FILE"}, {"output", 'o', 0, G_OPTION_ARG_FILENAME, &output_file, "destination FILE", "FILE"}, {"pipeline", 'p', 0, G_OPTION_ARG_FILENAME, &pipeline, "graphics PIPELINE to run", "PIPELINE"}, {"auto-enance", 'a', 0, G_OPTION_ARG_NONE, &auto_enhance, "run auto-enhance on input file", NULL}, {"format", 'f', 0, G_OPTION_ARG_STRING, &format, "Save output file in specific format [png, jpeg (default)]", NULL}, {"jobs", 'j', 0, G_OPTION_ARG_INT, &jobs, "Number of parallel jobs to run on an image", NULL}, {NULL, (gchar) 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL}}; + +static glong string_strnlen (gchar* str, glong maxlen) { + glong result = 0L; + gchar* end = NULL; + gchar* _tmp0_; + glong _tmp1_; + gchar* _tmp2_; + gchar* _tmp3_; +#line 1322 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp0_ = str; +#line 1322 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp1_ = maxlen; +#line 1322 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp2_ = memchr (_tmp0_, 0, (gsize) _tmp1_); +#line 1322 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + end = _tmp2_; +#line 1323 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp3_ = end; +#line 1323 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + if (_tmp3_ == NULL) { +#line 68 "graphics-processor.c" + glong _tmp4_; +#line 1324 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp4_ = maxlen; +#line 1324 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + result = _tmp4_; +#line 1324 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + return result; +#line 76 "graphics-processor.c" + } else { + gchar* _tmp5_; + gchar* _tmp6_; +#line 1326 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp5_ = end; +#line 1326 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp6_ = str; +#line 1326 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + result = (glong) (_tmp5_ - _tmp6_); +#line 1326 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + return result; +#line 88 "graphics-processor.c" + } +} + + +static gchar* string_substring (const gchar* self, glong offset, glong len) { + gchar* result = NULL; + glong string_length = 0L; + gboolean _tmp0_ = FALSE; + glong _tmp1_; + glong _tmp8_; + glong _tmp14_; + glong _tmp17_; + glong _tmp18_; + glong _tmp19_; + glong _tmp20_; + glong _tmp21_; + gchar* _tmp22_; +#line 1333 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + g_return_val_if_fail (self != NULL, NULL); +#line 1335 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp1_ = offset; +#line 1335 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + if (_tmp1_ >= ((glong) 0)) { +#line 112 "graphics-processor.c" + glong _tmp2_; +#line 1335 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp2_ = len; +#line 1335 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp0_ = _tmp2_ >= ((glong) 0); +#line 118 "graphics-processor.c" + } else { +#line 1335 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp0_ = FALSE; +#line 122 "graphics-processor.c" + } +#line 1335 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + if (_tmp0_) { +#line 126 "graphics-processor.c" + glong _tmp3_; + glong _tmp4_; + glong _tmp5_; +#line 1337 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp3_ = offset; +#line 1337 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp4_ = len; +#line 1337 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp5_ = string_strnlen ((gchar*) self, _tmp3_ + _tmp4_); +#line 1337 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + string_length = _tmp5_; +#line 138 "graphics-processor.c" + } else { + gint _tmp6_; + gint _tmp7_; +#line 1339 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp6_ = strlen (self); +#line 1339 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp7_ = _tmp6_; +#line 1339 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + string_length = (glong) _tmp7_; +#line 148 "graphics-processor.c" + } +#line 1342 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp8_ = offset; +#line 1342 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + if (_tmp8_ < ((glong) 0)) { +#line 154 "graphics-processor.c" + glong _tmp9_; + glong _tmp10_; + glong _tmp11_; +#line 1343 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp9_ = string_length; +#line 1343 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp10_ = offset; +#line 1343 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + offset = _tmp9_ + _tmp10_; +#line 1344 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp11_ = offset; +#line 1344 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + g_return_val_if_fail (_tmp11_ >= ((glong) 0), NULL); +#line 168 "graphics-processor.c" + } else { + glong _tmp12_; + glong _tmp13_; +#line 1346 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp12_ = offset; +#line 1346 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp13_ = string_length; +#line 1346 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + g_return_val_if_fail (_tmp12_ <= _tmp13_, NULL); +#line 178 "graphics-processor.c" + } +#line 1348 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp14_ = len; +#line 1348 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + if (_tmp14_ < ((glong) 0)) { +#line 184 "graphics-processor.c" + glong _tmp15_; + glong _tmp16_; +#line 1349 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp15_ = string_length; +#line 1349 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp16_ = offset; +#line 1349 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + len = _tmp15_ - _tmp16_; +#line 193 "graphics-processor.c" + } +#line 1351 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp17_ = offset; +#line 1351 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp18_ = len; +#line 1351 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp19_ = string_length; +#line 1351 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + g_return_val_if_fail ((_tmp17_ + _tmp18_) <= _tmp19_, NULL); +#line 1352 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp20_ = offset; +#line 1352 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp21_ = len; +#line 1352 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp22_ = g_strndup (((gchar*) self) + _tmp20_, (gsize) _tmp21_); +#line 1352 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + result = _tmp22_; +#line 1352 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + return result; +#line 213 "graphics-processor.c" +} + + +static gchar* string_replace (const gchar* self, const gchar* old, const gchar* replacement) { + gchar* result = NULL; + gboolean _tmp0_ = FALSE; + gboolean _tmp1_ = FALSE; + GError * _inner_error_ = NULL; +#line 1407 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + g_return_val_if_fail (self != NULL, NULL); +#line 1407 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + g_return_val_if_fail (old != NULL, NULL); +#line 1407 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + g_return_val_if_fail (replacement != NULL, NULL); +#line 1408 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + if ((*((gchar*) self)) == '\0') { +#line 1408 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp1_ = TRUE; +#line 232 "graphics-processor.c" + } else { + const gchar* _tmp2_; +#line 1408 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp2_ = old; +#line 1408 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp1_ = (*((gchar*) _tmp2_)) == '\0'; +#line 239 "graphics-processor.c" + } +#line 1408 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + if (_tmp1_) { +#line 1408 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp0_ = TRUE; +#line 245 "graphics-processor.c" + } else { + const gchar* _tmp3_; + const gchar* _tmp4_; +#line 1408 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp3_ = old; +#line 1408 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp4_ = replacement; +#line 1408 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp0_ = g_strcmp0 (_tmp3_, _tmp4_) == 0; +#line 255 "graphics-processor.c" + } +#line 1408 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + if (_tmp0_) { +#line 259 "graphics-processor.c" + gchar* _tmp5_; +#line 1409 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp5_ = g_strdup (self); +#line 1409 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + result = _tmp5_; +#line 1409 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + return result; +#line 267 "graphics-processor.c" + } + { + GRegex* regex = NULL; + const gchar* _tmp6_; + gchar* _tmp7_; + gchar* _tmp8_; + GRegex* _tmp9_; + GRegex* _tmp10_; + gchar* _tmp11_ = NULL; + GRegex* _tmp12_; + const gchar* _tmp13_; + gchar* _tmp14_; + gchar* _tmp15_; +#line 1412 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp6_ = old; +#line 1412 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp7_ = g_regex_escape_string (_tmp6_, -1); +#line 1412 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp8_ = _tmp7_; +#line 1412 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp9_ = g_regex_new (_tmp8_, 0, 0, &_inner_error_); +#line 1412 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp10_ = _tmp9_; +#line 1412 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _g_free0 (_tmp8_); +#line 1412 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + regex = _tmp10_; +#line 1412 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 1412 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + if (_inner_error_->domain == G_REGEX_ERROR) { +#line 299 "graphics-processor.c" + goto __catch1_g_regex_error; + } +#line 1412 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); +#line 1412 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + g_clear_error (&_inner_error_); +#line 1412 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + return NULL; +#line 308 "graphics-processor.c" + } +#line 1413 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp12_ = regex; +#line 1413 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp13_ = replacement; +#line 1413 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp14_ = g_regex_replace_literal (_tmp12_, self, (gssize) -1, 0, _tmp13_, 0, &_inner_error_); +#line 1413 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp11_ = _tmp14_; +#line 1413 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 1413 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _g_regex_unref0 (regex); +#line 1413 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + if (_inner_error_->domain == G_REGEX_ERROR) { +#line 324 "graphics-processor.c" + goto __catch1_g_regex_error; + } +#line 1413 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _g_regex_unref0 (regex); +#line 1413 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); +#line 1413 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + g_clear_error (&_inner_error_); +#line 1413 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + return NULL; +#line 335 "graphics-processor.c" + } +#line 1413 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp15_ = _tmp11_; +#line 1413 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _tmp11_ = NULL; +#line 1413 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + result = _tmp15_; +#line 1413 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _g_free0 (_tmp11_); +#line 1413 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _g_regex_unref0 (regex); +#line 1413 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + return result; +#line 349 "graphics-processor.c" + } + goto __finally1; + __catch1_g_regex_error: + { + GError* e = NULL; +#line 1411 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + e = _inner_error_; +#line 1411 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _inner_error_ = NULL; +#line 1415 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + g_assert_not_reached (); +#line 1411 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + _g_error_free0 (e); +#line 363 "graphics-processor.c" + } + __finally1: +#line 1411 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 1411 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + 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 1411 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + g_clear_error (&_inner_error_); +#line 1411 "/usr/share/vala-0.36/vapi/glib-2.0.vapi" + return NULL; +#line 374 "graphics-processor.c" + } +} + + +GeeHashMap* marshall_all_transformations (const gchar* filename) { + GeeHashMap* result = NULL; + GError * _inner_error_ = NULL; +#line 18 "/home/jens/Source/shotwell/src/graphics-processor.vala" + g_return_val_if_fail (filename != NULL, NULL); +#line 384 "graphics-processor.c" + { + GKeyFile* keyfile = NULL; + GKeyFile* _tmp0_; + const gchar* _tmp1_; + gboolean _tmp2_; + GeeHashMap* map = NULL; + GeeHashMap* _tmp17_; + gchar** objects = NULL; + GKeyFile* _tmp18_; + gsize _tmp19_; + gchar** _tmp20_; + gint objects_length1; + gint _objects_size_; + gchar** _tmp21_; + gint _tmp21__length1; +#line 20 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp0_ = g_key_file_new (); +#line 20 "/home/jens/Source/shotwell/src/graphics-processor.vala" + keyfile = _tmp0_; +#line 21 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp1_ = filename; +#line 21 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp2_ = g_str_has_prefix (_tmp1_, "string:"); +#line 21 "/home/jens/Source/shotwell/src/graphics-processor.vala" + if (_tmp2_) { +#line 410 "graphics-processor.c" + gchar* data = NULL; + const gchar* _tmp3_; + gchar* _tmp4_; + gchar* _tmp5_; + gchar* _tmp6_; + gchar* _tmp7_; + gchar* _tmp8_; + gchar* _tmp9_; + GKeyFile* _tmp10_; + const gchar* _tmp11_; + const gchar* _tmp12_; + gint _tmp13_; + gint _tmp14_; +#line 22 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp3_ = filename; +#line 22 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp4_ = string_substring (_tmp3_, (glong) 7, (glong) -1); +#line 22 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp5_ = _tmp4_; +#line 22 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp6_ = string_replace (_tmp5_, "&", "\n"); +#line 22 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp7_ = _tmp6_; +#line 22 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp8_ = g_strconcat ("[adjustments]\n", _tmp7_, NULL); +#line 22 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp9_ = _tmp8_; +#line 22 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _g_free0 (_tmp7_); +#line 22 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _g_free0 (_tmp5_); +#line 22 "/home/jens/Source/shotwell/src/graphics-processor.vala" + data = _tmp9_; +#line 23 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp10_ = keyfile; +#line 23 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp11_ = data; +#line 23 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp12_ = data; +#line 23 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp13_ = strlen (_tmp12_); +#line 23 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp14_ = _tmp13_; +#line 23 "/home/jens/Source/shotwell/src/graphics-processor.vala" + g_key_file_load_from_data (_tmp10_, _tmp11_, (gsize) _tmp14_, G_KEY_FILE_NONE, &_inner_error_); +#line 23 "/home/jens/Source/shotwell/src/graphics-processor.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 23 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _g_free0 (data); +#line 23 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _g_key_file_unref0 (keyfile); +#line 462 "graphics-processor.c" + goto __catch0_g_error; + } +#line 21 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _g_free0 (data); +#line 467 "graphics-processor.c" + } else { + GKeyFile* _tmp15_; + const gchar* _tmp16_; +#line 25 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp15_ = keyfile; +#line 25 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp16_ = filename; +#line 25 "/home/jens/Source/shotwell/src/graphics-processor.vala" + g_key_file_load_from_file (_tmp15_, _tmp16_, G_KEY_FILE_NONE, &_inner_error_); +#line 25 "/home/jens/Source/shotwell/src/graphics-processor.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 25 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _g_key_file_unref0 (keyfile); +#line 481 "graphics-processor.c" + goto __catch0_g_error; + } + } +#line 28 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp17_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, TYPE_KEY_VALUE_MAP, (GBoxedCopyFunc) key_value_map_ref, (GDestroyNotify) key_value_map_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +#line 28 "/home/jens/Source/shotwell/src/graphics-processor.vala" + map = _tmp17_; +#line 30 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp18_ = keyfile; +#line 30 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp20_ = g_key_file_get_groups (_tmp18_, &_tmp19_); +#line 30 "/home/jens/Source/shotwell/src/graphics-processor.vala" + objects = _tmp20_; +#line 30 "/home/jens/Source/shotwell/src/graphics-processor.vala" + objects_length1 = _tmp19_; +#line 30 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _objects_size_ = objects_length1; +#line 31 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp21_ = objects; +#line 31 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp21__length1 = objects_length1; +#line 503 "graphics-processor.c" + { + gchar** object_collection = NULL; + gint object_collection_length1 = 0; + gint _object_collection_size_ = 0; + gint object_it = 0; +#line 31 "/home/jens/Source/shotwell/src/graphics-processor.vala" + object_collection = _tmp21_; +#line 31 "/home/jens/Source/shotwell/src/graphics-processor.vala" + object_collection_length1 = _tmp21__length1; +#line 31 "/home/jens/Source/shotwell/src/graphics-processor.vala" + for (object_it = 0; object_it < _tmp21__length1; object_it = object_it + 1) { +#line 515 "graphics-processor.c" + gchar* _tmp22_; + gchar* object = NULL; +#line 31 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp22_ = g_strdup (object_collection[object_it]); +#line 31 "/home/jens/Source/shotwell/src/graphics-processor.vala" + object = _tmp22_; +#line 522 "graphics-processor.c" + { + gchar** keys = NULL; + GKeyFile* _tmp23_; + const gchar* _tmp24_; + gsize _tmp25_; + gchar** _tmp26_; + gint keys_length1; + gint _keys_size_; + gboolean _tmp27_ = FALSE; + gchar** _tmp28_; + gint _tmp28__length1; + KeyValueMap* key_map = NULL; + const gchar* _tmp30_; + KeyValueMap* _tmp31_; + gchar** _tmp32_; + gint _tmp32__length1; + GeeHashMap* _tmp41_; + const gchar* _tmp42_; + KeyValueMap* _tmp43_; +#line 32 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp23_ = keyfile; +#line 32 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp24_ = object; +#line 32 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp26_ = g_key_file_get_keys (_tmp23_, _tmp24_, &_tmp25_, &_inner_error_); +#line 32 "/home/jens/Source/shotwell/src/graphics-processor.vala" + keys = _tmp26_; +#line 32 "/home/jens/Source/shotwell/src/graphics-processor.vala" + keys_length1 = _tmp25_; +#line 32 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _keys_size_ = keys_length1; +#line 32 "/home/jens/Source/shotwell/src/graphics-processor.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 32 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _g_free0 (object); +#line 32 "/home/jens/Source/shotwell/src/graphics-processor.vala" + objects = (_vala_array_free (objects, objects_length1, (GDestroyNotify) g_free), NULL); +#line 32 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _g_object_unref0 (map); +#line 32 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _g_key_file_unref0 (keyfile); +#line 564 "graphics-processor.c" + goto __catch0_g_error; + } +#line 33 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp28_ = keys; +#line 33 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp28__length1 = keys_length1; +#line 33 "/home/jens/Source/shotwell/src/graphics-processor.vala" + if (_tmp28_ == NULL) { +#line 33 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp27_ = TRUE; +#line 575 "graphics-processor.c" + } else { + gchar** _tmp29_; + gint _tmp29__length1; +#line 33 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp29_ = keys; +#line 33 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp29__length1 = keys_length1; +#line 33 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp27_ = _tmp29__length1 == 0; +#line 585 "graphics-processor.c" + } +#line 33 "/home/jens/Source/shotwell/src/graphics-processor.vala" + if (_tmp27_) { +#line 34 "/home/jens/Source/shotwell/src/graphics-processor.vala" + keys = (_vala_array_free (keys, keys_length1, (GDestroyNotify) g_free), NULL); +#line 34 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _g_free0 (object); +#line 34 "/home/jens/Source/shotwell/src/graphics-processor.vala" + continue; +#line 595 "graphics-processor.c" + } +#line 37 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp30_ = object; +#line 37 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp31_ = key_value_map_new (_tmp30_); +#line 37 "/home/jens/Source/shotwell/src/graphics-processor.vala" + key_map = _tmp31_; +#line 38 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp32_ = keys; +#line 38 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp32__length1 = keys_length1; +#line 607 "graphics-processor.c" + { + gchar** key_collection = NULL; + gint key_collection_length1 = 0; + gint _key_collection_size_ = 0; + gint key_it = 0; +#line 38 "/home/jens/Source/shotwell/src/graphics-processor.vala" + key_collection = _tmp32_; +#line 38 "/home/jens/Source/shotwell/src/graphics-processor.vala" + key_collection_length1 = _tmp32__length1; +#line 38 "/home/jens/Source/shotwell/src/graphics-processor.vala" + for (key_it = 0; key_it < _tmp32__length1; key_it = key_it + 1) { +#line 619 "graphics-processor.c" + gchar* _tmp33_; + gchar* key = NULL; +#line 38 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp33_ = g_strdup (key_collection[key_it]); +#line 38 "/home/jens/Source/shotwell/src/graphics-processor.vala" + key = _tmp33_; +#line 626 "graphics-processor.c" + { + gchar* _tmp34_ = NULL; + GKeyFile* _tmp35_; + const gchar* _tmp36_; + const gchar* _tmp37_; + gchar* _tmp38_; + KeyValueMap* _tmp39_; + const gchar* _tmp40_; +#line 39 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp35_ = keyfile; +#line 39 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp36_ = object; +#line 39 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp37_ = key; +#line 39 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp38_ = g_key_file_get_string (_tmp35_, _tmp36_, _tmp37_, &_inner_error_); +#line 39 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp34_ = _tmp38_; +#line 39 "/home/jens/Source/shotwell/src/graphics-processor.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 39 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _g_free0 (key); +#line 39 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _key_value_map_unref0 (key_map); +#line 39 "/home/jens/Source/shotwell/src/graphics-processor.vala" + keys = (_vala_array_free (keys, keys_length1, (GDestroyNotify) g_free), NULL); +#line 39 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _g_free0 (object); +#line 39 "/home/jens/Source/shotwell/src/graphics-processor.vala" + objects = (_vala_array_free (objects, objects_length1, (GDestroyNotify) g_free), NULL); +#line 39 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _g_object_unref0 (map); +#line 39 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _g_key_file_unref0 (keyfile); +#line 661 "graphics-processor.c" + goto __catch0_g_error; + } +#line 39 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp39_ = key_map; +#line 39 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp40_ = key; +#line 39 "/home/jens/Source/shotwell/src/graphics-processor.vala" + key_value_map_set_string (_tmp39_, _tmp40_, _tmp34_); +#line 38 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _g_free0 (_tmp34_); +#line 38 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _g_free0 (key); +#line 674 "graphics-processor.c" + } + } + } +#line 41 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp41_ = map; +#line 41 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp42_ = object; +#line 41 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp43_ = key_map; +#line 41 "/home/jens/Source/shotwell/src/graphics-processor.vala" + gee_abstract_map_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp41_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp42_, _tmp43_); +#line 31 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _key_value_map_unref0 (key_map); +#line 31 "/home/jens/Source/shotwell/src/graphics-processor.vala" + keys = (_vala_array_free (keys, keys_length1, (GDestroyNotify) g_free), NULL); +#line 31 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _g_free0 (object); +#line 692 "graphics-processor.c" + } + } + } +#line 44 "/home/jens/Source/shotwell/src/graphics-processor.vala" + result = map; +#line 44 "/home/jens/Source/shotwell/src/graphics-processor.vala" + objects = (_vala_array_free (objects, objects_length1, (GDestroyNotify) g_free), NULL); +#line 44 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _g_key_file_unref0 (keyfile); +#line 44 "/home/jens/Source/shotwell/src/graphics-processor.vala" + return result; +#line 704 "graphics-processor.c" + } + goto __finally0; + __catch0_g_error: + { + GError* err = NULL; + const gchar* _tmp44_; +#line 19 "/home/jens/Source/shotwell/src/graphics-processor.vala" + err = _inner_error_; +#line 19 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _inner_error_ = NULL; +#line 46 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp44_ = err->message; +#line 46 "/home/jens/Source/shotwell/src/graphics-processor.vala" + g_error ("graphics-processor.vala:46: %s", _tmp44_); +#line 19 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _g_error_free0 (err); +#line 721 "graphics-processor.c" + } + __finally0: +#line 19 "/home/jens/Source/shotwell/src/graphics-processor.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 19 "/home/jens/Source/shotwell/src/graphics-processor.vala" + g_clear_error (&_inner_error_); +#line 19 "/home/jens/Source/shotwell/src/graphics-processor.vala" + return NULL; +#line 730 "graphics-processor.c" +} + + +gint _vala_main (gchar** args, int args_length1) { + gint result = 0; + GOptionContext* ctx = NULL; + GOptionContext* _tmp0_; + GOptionContext* _tmp1_; + GOptionContext* _tmp2_; + GOptionContext* _tmp3_; + gboolean _tmp9_ = FALSE; + const gchar* _tmp10_; + gboolean _tmp15_ = FALSE; + gboolean _tmp16_; + GdkPixbuf* src = NULL; + GdkPixbuf* output = NULL; + GdkPixbuf* _tmp24_; + GdkPixbuf* _tmp25_; + PixelTransformationBundle* adjustments = NULL; + const gchar* _tmp26_; + gboolean _tmp36_; + PixelTransformer* transformer = NULL; + PixelTransformationBundle* _tmp39_; + PixelTransformer* _tmp40_; + GTimer* timer = NULL; + GTimer* _tmp41_; + PixelTransformer* _tmp42_; + GdkPixbuf* _tmp43_; + GdkPixbuf* _tmp44_; + gint _tmp45_; + gdouble elapsed = 0.0; + GTimer* _tmp46_; + gdouble _tmp47_; + gdouble _tmp48_; + const gchar* _tmp49_; + GError * _inner_error_ = NULL; +#line 51 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp0_ = g_option_context_new ("- Apply shotwell transformations on commandline"); +#line 51 "/home/jens/Source/shotwell/src/graphics-processor.vala" + ctx = _tmp0_; +#line 52 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp1_ = ctx; +#line 52 "/home/jens/Source/shotwell/src/graphics-processor.vala" + g_option_context_set_help_enabled (_tmp1_, TRUE); +#line 53 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp2_ = ctx; +#line 53 "/home/jens/Source/shotwell/src/graphics-processor.vala" + g_option_context_set_ignore_unknown_options (_tmp2_, TRUE); +#line 54 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp3_ = ctx; +#line 54 "/home/jens/Source/shotwell/src/graphics-processor.vala" + g_option_context_add_main_entries (_tmp3_, options, NULL); +#line 783 "graphics-processor.c" + { + GOptionContext* _tmp4_; +#line 57 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp4_ = ctx; +#line 57 "/home/jens/Source/shotwell/src/graphics-processor.vala" + g_option_context_parse (_tmp4_, &args_length1, &args, &_inner_error_); +#line 57 "/home/jens/Source/shotwell/src/graphics-processor.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 792 "graphics-processor.c" + goto __catch2_g_error; + } + } + goto __finally2; + __catch2_g_error: + { + GError* _error_ = NULL; + GOptionContext* _tmp5_; + gchar* _tmp6_; + gchar* _tmp7_; +#line 56 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _error_ = _inner_error_; +#line 56 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _inner_error_ = NULL; +#line 59 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp5_ = ctx; +#line 59 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp6_ = g_option_context_get_help (_tmp5_, TRUE, NULL); +#line 59 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp7_ = _tmp6_; +#line 59 "/home/jens/Source/shotwell/src/graphics-processor.vala" + g_print ("%s", _tmp7_); +#line 59 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _g_free0 (_tmp7_); +#line 61 "/home/jens/Source/shotwell/src/graphics-processor.vala" + result = 1; +#line 61 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _g_error_free0 (_error_); +#line 61 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _g_option_context_free0 (ctx); +#line 61 "/home/jens/Source/shotwell/src/graphics-processor.vala" + return result; +#line 825 "graphics-processor.c" + } + __finally2: +#line 56 "/home/jens/Source/shotwell/src/graphics-processor.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 830 "graphics-processor.c" + gint _tmp8_ = 0; +#line 56 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _g_option_context_free0 (ctx); +#line 56 "/home/jens/Source/shotwell/src/graphics-processor.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 56 "/home/jens/Source/shotwell/src/graphics-processor.vala" + g_clear_error (&_inner_error_); +#line 56 "/home/jens/Source/shotwell/src/graphics-processor.vala" + return _tmp8_; +#line 840 "graphics-processor.c" + } +#line 64 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp10_ = input_file; +#line 64 "/home/jens/Source/shotwell/src/graphics-processor.vala" + if (_tmp10_ == NULL) { +#line 64 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp9_ = TRUE; +#line 848 "graphics-processor.c" + } else { + const gchar* _tmp11_; +#line 64 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp11_ = output_file; +#line 64 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp9_ = _tmp11_ == NULL; +#line 855 "graphics-processor.c" + } +#line 64 "/home/jens/Source/shotwell/src/graphics-processor.vala" + if (_tmp9_) { +#line 859 "graphics-processor.c" + GOptionContext* _tmp12_; + gchar* _tmp13_; + gchar* _tmp14_; +#line 65 "/home/jens/Source/shotwell/src/graphics-processor.vala" + g_print ("You need to provide and input and output file\n"); +#line 66 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp12_ = ctx; +#line 66 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp13_ = g_option_context_get_help (_tmp12_, TRUE, NULL); +#line 66 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp14_ = _tmp13_; +#line 66 "/home/jens/Source/shotwell/src/graphics-processor.vala" + g_print ("%s", _tmp14_); +#line 66 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _g_free0 (_tmp14_); +#line 68 "/home/jens/Source/shotwell/src/graphics-processor.vala" + result = 1; +#line 68 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _g_option_context_free0 (ctx); +#line 68 "/home/jens/Source/shotwell/src/graphics-processor.vala" + return result; +#line 881 "graphics-processor.c" + } +#line 71 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp16_ = auto_enhance; +#line 71 "/home/jens/Source/shotwell/src/graphics-processor.vala" + if (_tmp16_ == FALSE) { +#line 887 "graphics-processor.c" + const gchar* _tmp17_; +#line 71 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp17_ = pipeline; +#line 71 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp15_ = _tmp17_ == NULL; +#line 893 "graphics-processor.c" + } else { +#line 71 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp15_ = FALSE; +#line 897 "graphics-processor.c" + } +#line 71 "/home/jens/Source/shotwell/src/graphics-processor.vala" + if (_tmp15_) { +#line 72 "/home/jens/Source/shotwell/src/graphics-processor.vala" + g_print ("No operation provided. Nothing to do.\n"); +#line 74 "/home/jens/Source/shotwell/src/graphics-processor.vala" + result = 0; +#line 74 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _g_option_context_free0 (ctx); +#line 74 "/home/jens/Source/shotwell/src/graphics-processor.vala" + return result; +#line 909 "graphics-processor.c" + } +#line 77 "/home/jens/Source/shotwell/src/graphics-processor.vala" + src = NULL; +#line 913 "graphics-processor.c" + { + GdkPixbuf* _tmp18_ = NULL; + const gchar* _tmp19_; + GdkPixbuf* _tmp20_; + GdkPixbuf* _tmp21_; +#line 79 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp19_ = input_file; +#line 79 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp20_ = gdk_pixbuf_new_from_file (_tmp19_, &_inner_error_); +#line 79 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp18_ = _tmp20_; +#line 79 "/home/jens/Source/shotwell/src/graphics-processor.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 927 "graphics-processor.c" + goto __catch3_g_error; + } +#line 79 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp21_ = _tmp18_; +#line 79 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp18_ = NULL; +#line 79 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _g_object_unref0 (src); +#line 79 "/home/jens/Source/shotwell/src/graphics-processor.vala" + src = _tmp21_; +#line 78 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _g_object_unref0 (_tmp18_); +#line 940 "graphics-processor.c" + } + goto __finally3; + __catch3_g_error: + { + GError* err = NULL; + const gchar* _tmp22_; +#line 78 "/home/jens/Source/shotwell/src/graphics-processor.vala" + err = _inner_error_; +#line 78 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _inner_error_ = NULL; +#line 81 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp22_ = err->message; +#line 81 "/home/jens/Source/shotwell/src/graphics-processor.vala" + g_error ("graphics-processor.vala:81: %s", _tmp22_); +#line 78 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _g_error_free0 (err); +#line 957 "graphics-processor.c" + } + __finally3: +#line 78 "/home/jens/Source/shotwell/src/graphics-processor.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 962 "graphics-processor.c" + gint _tmp23_ = 0; +#line 78 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _g_object_unref0 (src); +#line 78 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _g_option_context_free0 (ctx); +#line 78 "/home/jens/Source/shotwell/src/graphics-processor.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 78 "/home/jens/Source/shotwell/src/graphics-processor.vala" + g_clear_error (&_inner_error_); +#line 78 "/home/jens/Source/shotwell/src/graphics-processor.vala" + return _tmp23_; +#line 974 "graphics-processor.c" + } +#line 84 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp24_ = src; +#line 84 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp25_ = gdk_pixbuf_copy (_tmp24_); +#line 84 "/home/jens/Source/shotwell/src/graphics-processor.vala" + output = _tmp25_; +#line 85 "/home/jens/Source/shotwell/src/graphics-processor.vala" + adjustments = NULL; +#line 87 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp26_ = pipeline; +#line 87 "/home/jens/Source/shotwell/src/graphics-processor.vala" + if (_tmp26_ != NULL) { +#line 988 "graphics-processor.c" + GeeHashMap* transformations = NULL; + const gchar* _tmp27_; + GeeHashMap* _tmp28_; + PixelTransformationBundle* _tmp29_; + KeyValueMap* map = NULL; + GeeHashMap* _tmp30_; + gpointer _tmp31_; + KeyValueMap* _tmp32_; +#line 88 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp27_ = pipeline; +#line 88 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp28_ = marshall_all_transformations (_tmp27_); +#line 88 "/home/jens/Source/shotwell/src/graphics-processor.vala" + transformations = _tmp28_; +#line 90 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp29_ = pixel_transformation_bundle_new (); +#line 90 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _pixel_transformation_bundle_unref0 (adjustments); +#line 90 "/home/jens/Source/shotwell/src/graphics-processor.vala" + adjustments = _tmp29_; +#line 91 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp30_ = transformations; +#line 91 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp31_ = gee_abstract_map_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp30_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), "adjustments"); +#line 91 "/home/jens/Source/shotwell/src/graphics-processor.vala" + map = (KeyValueMap*) _tmp31_; +#line 92 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp32_ = map; +#line 92 "/home/jens/Source/shotwell/src/graphics-processor.vala" + if (_tmp32_ == NULL) { +#line 1019 "graphics-processor.c" + PixelTransformationBundle* _tmp33_; +#line 93 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp33_ = adjustments; +#line 93 "/home/jens/Source/shotwell/src/graphics-processor.vala" + pixel_transformation_bundle_set_to_identity (_tmp33_); +#line 1025 "graphics-processor.c" + } else { + PixelTransformationBundle* _tmp34_; + KeyValueMap* _tmp35_; +#line 95 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp34_ = adjustments; +#line 95 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp35_ = map; +#line 95 "/home/jens/Source/shotwell/src/graphics-processor.vala" + pixel_transformation_bundle_load (_tmp34_, _tmp35_); +#line 1035 "graphics-processor.c" + } +#line 87 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _key_value_map_unref0 (map); +#line 87 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _g_object_unref0 (transformations); +#line 1041 "graphics-processor.c" + } +#line 99 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp36_ = auto_enhance; +#line 99 "/home/jens/Source/shotwell/src/graphics-processor.vala" + if (_tmp36_) { +#line 1047 "graphics-processor.c" + GdkPixbuf* _tmp37_; + PixelTransformationBundle* _tmp38_; +#line 100 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp37_ = src; +#line 100 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp38_ = auto_enhance_create_auto_enhance_adjustments (_tmp37_); +#line 100 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _pixel_transformation_bundle_unref0 (adjustments); +#line 100 "/home/jens/Source/shotwell/src/graphics-processor.vala" + adjustments = _tmp38_; +#line 1058 "graphics-processor.c" + } +#line 103 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp39_ = adjustments; +#line 103 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp40_ = pixel_transformation_bundle_generate_transformer (_tmp39_); +#line 103 "/home/jens/Source/shotwell/src/graphics-processor.vala" + transformer = _tmp40_; +#line 104 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp41_ = g_timer_new (); +#line 104 "/home/jens/Source/shotwell/src/graphics-processor.vala" + timer = _tmp41_; +#line 105 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp42_ = transformer; +#line 105 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp43_ = src; +#line 105 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp44_ = output; +#line 105 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp45_ = jobs; +#line 105 "/home/jens/Source/shotwell/src/graphics-processor.vala" + pixel_transformer_transform_to_other_pixbuf (_tmp42_, _tmp43_, _tmp44_, NULL, _tmp45_); +#line 106 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp46_ = timer; +#line 106 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp47_ = g_timer_elapsed (_tmp46_, NULL); +#line 106 "/home/jens/Source/shotwell/src/graphics-processor.vala" + elapsed = _tmp47_; +#line 108 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp48_ = elapsed; +#line 108 "/home/jens/Source/shotwell/src/graphics-processor.vala" + g_print ("Transformation took %f\n", _tmp48_); +#line 111 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp49_ = format; +#line 111 "/home/jens/Source/shotwell/src/graphics-processor.vala" + if (_tmp49_ == NULL) { +#line 1094 "graphics-processor.c" + gchar* content_type = NULL; + const gchar* _tmp50_; + gchar* _tmp51_; + const gchar* _tmp52_; + gchar* _tmp54_; +#line 112 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp50_ = output_file; +#line 112 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp51_ = g_content_type_guess (_tmp50_, NULL, (gsize) 0, NULL); +#line 112 "/home/jens/Source/shotwell/src/graphics-processor.vala" + content_type = _tmp51_; +#line 113 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp52_ = content_type; +#line 113 "/home/jens/Source/shotwell/src/graphics-processor.vala" + if (g_strcmp0 (_tmp52_, "image/png") == 0) { +#line 1110 "graphics-processor.c" + gchar* _tmp53_; +#line 114 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp53_ = g_strdup ("png"); +#line 114 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _g_free0 (format); +#line 114 "/home/jens/Source/shotwell/src/graphics-processor.vala" + format = _tmp53_; +#line 1118 "graphics-processor.c" + } +#line 117 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp54_ = g_strdup ("jpeg"); +#line 117 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _g_free0 (format); +#line 117 "/home/jens/Source/shotwell/src/graphics-processor.vala" + format = _tmp54_; +#line 111 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _g_free0 (content_type); +#line 1128 "graphics-processor.c" + } + { + GdkPixbuf* _tmp55_; + const gchar* _tmp56_; + const gchar* _tmp57_; +#line 121 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp55_ = output; +#line 121 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp56_ = output_file; +#line 121 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp57_ = format; +#line 121 "/home/jens/Source/shotwell/src/graphics-processor.vala" + gdk_pixbuf_save (_tmp55_, _tmp56_, _tmp57_, &_inner_error_, NULL, NULL); +#line 121 "/home/jens/Source/shotwell/src/graphics-processor.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 1144 "graphics-processor.c" + goto __catch4_g_error; + } + } + goto __finally4; + __catch4_g_error: + { + GError* err = NULL; + const gchar* _tmp58_; +#line 120 "/home/jens/Source/shotwell/src/graphics-processor.vala" + err = _inner_error_; +#line 120 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _inner_error_ = NULL; +#line 123 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _tmp58_ = err->message; +#line 123 "/home/jens/Source/shotwell/src/graphics-processor.vala" + g_error ("graphics-processor.vala:123: %s", _tmp58_); +#line 120 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _g_error_free0 (err); +#line 1163 "graphics-processor.c" + } + __finally4: +#line 120 "/home/jens/Source/shotwell/src/graphics-processor.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 1168 "graphics-processor.c" + gint _tmp59_ = 0; +#line 120 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _g_timer_destroy0 (timer); +#line 120 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _pixel_transformer_unref0 (transformer); +#line 120 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _pixel_transformation_bundle_unref0 (adjustments); +#line 120 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _g_object_unref0 (output); +#line 120 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _g_object_unref0 (src); +#line 120 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _g_option_context_free0 (ctx); +#line 120 "/home/jens/Source/shotwell/src/graphics-processor.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 120 "/home/jens/Source/shotwell/src/graphics-processor.vala" + g_clear_error (&_inner_error_); +#line 120 "/home/jens/Source/shotwell/src/graphics-processor.vala" + return _tmp59_; +#line 1188 "graphics-processor.c" + } +#line 126 "/home/jens/Source/shotwell/src/graphics-processor.vala" + result = 0; +#line 126 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _g_timer_destroy0 (timer); +#line 126 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _pixel_transformer_unref0 (transformer); +#line 126 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _pixel_transformation_bundle_unref0 (adjustments); +#line 126 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _g_object_unref0 (output); +#line 126 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _g_object_unref0 (src); +#line 126 "/home/jens/Source/shotwell/src/graphics-processor.vala" + _g_option_context_free0 (ctx); +#line 126 "/home/jens/Source/shotwell/src/graphics-processor.vala" + return result; +#line 1206 "graphics-processor.c" +} + + +int main (int argc, char ** argv) { +#if !GLIB_CHECK_VERSION (2,35,0) + g_type_init (); +#endif +#line 50 "/home/jens/Source/shotwell/src/graphics-processor.vala" + return _vala_main (argv, argc); +#line 1216 "graphics-processor.c" +} + + +static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) { + if ((array != NULL) && (destroy_func != NULL)) { + int i; + for (i = 0; i < array_length; i = i + 1) { + if (((gpointer*) array)[i] != NULL) { + destroy_func (((gpointer*) array)[i]); + } + } + } +} + + +static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) { + _vala_array_destroy (array, array_length, destroy_func); + g_free (array); +} + + + |