/* graphics-processor.c generated by valac 0.34.7, 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;

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[6] = {{"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}, {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_ = NULL;
	glong _tmp1_ = 0L;
	gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
#line 1295 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp0_ = str;
#line 1295 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp1_ = maxlen;
#line 1295 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp2_ = memchr (_tmp0_, 0, (gsize) _tmp1_);
#line 1295 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	end = _tmp2_;
#line 1296 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp3_ = end;
#line 1296 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	if (_tmp3_ == NULL) {
#line 66 "graphics-processor.c"
		glong _tmp4_ = 0L;
#line 1297 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp4_ = maxlen;
#line 1297 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		result = _tmp4_;
#line 1297 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		return result;
#line 74 "graphics-processor.c"
	} else {
		gchar* _tmp5_ = NULL;
		gchar* _tmp6_ = NULL;
#line 1299 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp5_ = end;
#line 1299 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp6_ = str;
#line 1299 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		result = (glong) (_tmp5_ - _tmp6_);
#line 1299 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		return result;
#line 86 "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_ = 0L;
	glong _tmp8_ = 0L;
	glong _tmp14_ = 0L;
	glong _tmp17_ = 0L;
	glong _tmp18_ = 0L;
	glong _tmp19_ = 0L;
	glong _tmp20_ = 0L;
	glong _tmp21_ = 0L;
	gchar* _tmp22_ = NULL;
#line 1306 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, NULL);
#line 1308 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp1_ = offset;
#line 1308 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	if (_tmp1_ >= ((glong) 0)) {
#line 110 "graphics-processor.c"
		glong _tmp2_ = 0L;
#line 1308 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp2_ = len;
#line 1308 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp0_ = _tmp2_ >= ((glong) 0);
#line 116 "graphics-processor.c"
	} else {
#line 1308 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp0_ = FALSE;
#line 120 "graphics-processor.c"
	}
#line 1308 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	if (_tmp0_) {
#line 124 "graphics-processor.c"
		glong _tmp3_ = 0L;
		glong _tmp4_ = 0L;
		glong _tmp5_ = 0L;
#line 1310 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp3_ = offset;
#line 1310 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp4_ = len;
#line 1310 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp5_ = string_strnlen ((gchar*) self, _tmp3_ + _tmp4_);
#line 1310 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		string_length = _tmp5_;
#line 136 "graphics-processor.c"
	} else {
		gint _tmp6_ = 0;
		gint _tmp7_ = 0;
#line 1312 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp6_ = strlen (self);
#line 1312 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp7_ = _tmp6_;
#line 1312 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		string_length = (glong) _tmp7_;
#line 146 "graphics-processor.c"
	}
#line 1315 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp8_ = offset;
#line 1315 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	if (_tmp8_ < ((glong) 0)) {
#line 152 "graphics-processor.c"
		glong _tmp9_ = 0L;
		glong _tmp10_ = 0L;
		glong _tmp11_ = 0L;
#line 1316 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp9_ = string_length;
#line 1316 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp10_ = offset;
#line 1316 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		offset = _tmp9_ + _tmp10_;
#line 1317 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp11_ = offset;
#line 1317 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		g_return_val_if_fail (_tmp11_ >= ((glong) 0), NULL);
#line 166 "graphics-processor.c"
	} else {
		glong _tmp12_ = 0L;
		glong _tmp13_ = 0L;
#line 1319 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp12_ = offset;
#line 1319 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp13_ = string_length;
#line 1319 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		g_return_val_if_fail (_tmp12_ <= _tmp13_, NULL);
#line 176 "graphics-processor.c"
	}
#line 1321 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp14_ = len;
#line 1321 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	if (_tmp14_ < ((glong) 0)) {
#line 182 "graphics-processor.c"
		glong _tmp15_ = 0L;
		glong _tmp16_ = 0L;
#line 1322 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp15_ = string_length;
#line 1322 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp16_ = offset;
#line 1322 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		len = _tmp15_ - _tmp16_;
#line 191 "graphics-processor.c"
	}
#line 1324 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp17_ = offset;
#line 1324 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp18_ = len;
#line 1324 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp19_ = string_length;
#line 1324 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	g_return_val_if_fail ((_tmp17_ + _tmp18_) <= _tmp19_, NULL);
#line 1325 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp20_ = offset;
#line 1325 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp21_ = len;
#line 1325 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp22_ = g_strndup (((gchar*) self) + _tmp20_, (gsize) _tmp21_);
#line 1325 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	result = _tmp22_;
#line 1325 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	return result;
#line 211 "graphics-processor.c"
}


static gchar* string_replace (const gchar* self, const gchar* old, const gchar* replacement) {
	gchar* result = NULL;
	GError * _inner_error_ = NULL;
#line 1380 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, NULL);
#line 1380 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	g_return_val_if_fail (old != NULL, NULL);
#line 1380 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	g_return_val_if_fail (replacement != NULL, NULL);
#line 224 "graphics-processor.c"
	{
		GRegex* regex = NULL;
		const gchar* _tmp0_ = NULL;
		gchar* _tmp1_ = NULL;
		gchar* _tmp2_ = NULL;
		GRegex* _tmp3_ = NULL;
		GRegex* _tmp4_ = NULL;
		gchar* _tmp5_ = NULL;
		GRegex* _tmp6_ = NULL;
		const gchar* _tmp7_ = NULL;
		gchar* _tmp8_ = NULL;
		gchar* _tmp9_ = NULL;
#line 1382 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp0_ = old;
#line 1382 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp1_ = g_regex_escape_string (_tmp0_, -1);
#line 1382 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp2_ = _tmp1_;
#line 1382 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp3_ = g_regex_new (_tmp2_, 0, 0, &_inner_error_);
#line 1382 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp4_ = _tmp3_;
#line 1382 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_g_free0 (_tmp2_);
#line 1382 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		regex = _tmp4_;
#line 1382 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1382 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
			if (_inner_error_->domain == G_REGEX_ERROR) {
#line 255 "graphics-processor.c"
				goto __catch1_g_regex_error;
			}
#line 1382 "/usr/share/vala-0.34/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 1382 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
			g_clear_error (&_inner_error_);
#line 1382 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
			return NULL;
#line 264 "graphics-processor.c"
		}
#line 1383 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp6_ = regex;
#line 1383 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp7_ = replacement;
#line 1383 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp8_ = g_regex_replace_literal (_tmp6_, self, (gssize) -1, 0, _tmp7_, 0, &_inner_error_);
#line 1383 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp5_ = _tmp8_;
#line 1383 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1383 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
			_g_regex_unref0 (regex);
#line 1383 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
			if (_inner_error_->domain == G_REGEX_ERROR) {
#line 280 "graphics-processor.c"
				goto __catch1_g_regex_error;
			}
#line 1383 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
			_g_regex_unref0 (regex);
#line 1383 "/usr/share/vala-0.34/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 1383 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
			g_clear_error (&_inner_error_);
#line 1383 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
			return NULL;
#line 291 "graphics-processor.c"
		}
#line 1383 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp9_ = _tmp5_;
#line 1383 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp5_ = NULL;
#line 1383 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		result = _tmp9_;
#line 1383 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_g_free0 (_tmp5_);
#line 1383 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_g_regex_unref0 (regex);
#line 1383 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		return result;
#line 305 "graphics-processor.c"
	}
	goto __finally1;
	__catch1_g_regex_error:
	{
		GError* e = NULL;
#line 1381 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		e = _inner_error_;
#line 1381 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_inner_error_ = NULL;
#line 1385 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		g_assert_not_reached ();
#line 1381 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_g_error_free0 (e);
#line 319 "graphics-processor.c"
	}
	__finally1:
#line 1381 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1381 "/usr/share/vala-0.34/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 1381 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		g_clear_error (&_inner_error_);
#line 1381 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		return NULL;
#line 330 "graphics-processor.c"
	}
}


GeeHashMap* marshall_all_transformations (const gchar* filename) {
	GeeHashMap* result = NULL;
	GError * _inner_error_ = NULL;
#line 16 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	g_return_val_if_fail (filename != NULL, NULL);
#line 340 "graphics-processor.c"
	{
		GKeyFile* keyfile = NULL;
		GKeyFile* _tmp0_ = NULL;
		const gchar* _tmp1_ = NULL;
		gboolean _tmp2_ = FALSE;
		GeeHashMap* map = NULL;
		GeeHashMap* _tmp17_ = NULL;
		gchar** objects = NULL;
		GKeyFile* _tmp18_ = NULL;
		gsize _tmp19_;
		gchar** _tmp20_ = NULL;
		gint objects_length1 = 0;
		gint _objects_size_ = 0;
		gchar** _tmp21_ = NULL;
		gint _tmp21__length1 = 0;
#line 18 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_tmp0_ = g_key_file_new ();
#line 18 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		keyfile = _tmp0_;
#line 19 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_tmp1_ = filename;
#line 19 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_tmp2_ = g_str_has_prefix (_tmp1_, "string:");
#line 19 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		if (_tmp2_) {
#line 366 "graphics-processor.c"
			gchar* data = NULL;
			const gchar* _tmp3_ = NULL;
			gchar* _tmp4_ = NULL;
			gchar* _tmp5_ = NULL;
			gchar* _tmp6_ = NULL;
			gchar* _tmp7_ = NULL;
			gchar* _tmp8_ = NULL;
			gchar* _tmp9_ = NULL;
			GKeyFile* _tmp10_ = NULL;
			const gchar* _tmp11_ = NULL;
			const gchar* _tmp12_ = NULL;
			gint _tmp13_ = 0;
			gint _tmp14_ = 0;
#line 20 "/home/jens/Source/shotwell/src/graphics-processor.vala"
			_tmp3_ = filename;
#line 20 "/home/jens/Source/shotwell/src/graphics-processor.vala"
			_tmp4_ = string_substring (_tmp3_, (glong) 7, (glong) -1);
#line 20 "/home/jens/Source/shotwell/src/graphics-processor.vala"
			_tmp5_ = _tmp4_;
#line 20 "/home/jens/Source/shotwell/src/graphics-processor.vala"
			_tmp6_ = string_replace (_tmp5_, "&", "\n");
#line 20 "/home/jens/Source/shotwell/src/graphics-processor.vala"
			_tmp7_ = _tmp6_;
#line 20 "/home/jens/Source/shotwell/src/graphics-processor.vala"
			_tmp8_ = g_strconcat ("[adjustments]\n", _tmp7_, NULL);
#line 20 "/home/jens/Source/shotwell/src/graphics-processor.vala"
			_tmp9_ = _tmp8_;
#line 20 "/home/jens/Source/shotwell/src/graphics-processor.vala"
			_g_free0 (_tmp7_);
#line 20 "/home/jens/Source/shotwell/src/graphics-processor.vala"
			_g_free0 (_tmp5_);
#line 20 "/home/jens/Source/shotwell/src/graphics-processor.vala"
			data = _tmp9_;
#line 21 "/home/jens/Source/shotwell/src/graphics-processor.vala"
			_tmp10_ = keyfile;
#line 21 "/home/jens/Source/shotwell/src/graphics-processor.vala"
			_tmp11_ = data;
#line 21 "/home/jens/Source/shotwell/src/graphics-processor.vala"
			_tmp12_ = data;
#line 21 "/home/jens/Source/shotwell/src/graphics-processor.vala"
			_tmp13_ = strlen (_tmp12_);
#line 21 "/home/jens/Source/shotwell/src/graphics-processor.vala"
			_tmp14_ = _tmp13_;
#line 21 "/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 21 "/home/jens/Source/shotwell/src/graphics-processor.vala"
			if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 21 "/home/jens/Source/shotwell/src/graphics-processor.vala"
				_g_free0 (data);
#line 21 "/home/jens/Source/shotwell/src/graphics-processor.vala"
				_g_key_file_unref0 (keyfile);
#line 418 "graphics-processor.c"
				goto __catch0_g_error;
			}
#line 19 "/home/jens/Source/shotwell/src/graphics-processor.vala"
			_g_free0 (data);
#line 423 "graphics-processor.c"
		} else {
			GKeyFile* _tmp15_ = NULL;
			const gchar* _tmp16_ = NULL;
#line 23 "/home/jens/Source/shotwell/src/graphics-processor.vala"
			_tmp15_ = keyfile;
#line 23 "/home/jens/Source/shotwell/src/graphics-processor.vala"
			_tmp16_ = filename;
#line 23 "/home/jens/Source/shotwell/src/graphics-processor.vala"
			g_key_file_load_from_file (_tmp15_, _tmp16_, 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_key_file_unref0 (keyfile);
#line 437 "graphics-processor.c"
				goto __catch0_g_error;
			}
		}
#line 26 "/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 26 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		map = _tmp17_;
#line 28 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_tmp18_ = keyfile;
#line 28 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_tmp20_ = g_key_file_get_groups (_tmp18_, &_tmp19_);
#line 28 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		objects = _tmp20_;
#line 28 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		objects_length1 = _tmp19_;
#line 28 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_objects_size_ = objects_length1;
#line 29 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_tmp21_ = objects;
#line 29 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_tmp21__length1 = objects_length1;
#line 459 "graphics-processor.c"
		{
			gchar** object_collection = NULL;
			gint object_collection_length1 = 0;
			gint _object_collection_size_ = 0;
			gint object_it = 0;
#line 29 "/home/jens/Source/shotwell/src/graphics-processor.vala"
			object_collection = _tmp21_;
#line 29 "/home/jens/Source/shotwell/src/graphics-processor.vala"
			object_collection_length1 = _tmp21__length1;
#line 29 "/home/jens/Source/shotwell/src/graphics-processor.vala"
			for (object_it = 0; object_it < _tmp21__length1; object_it = object_it + 1) {
#line 471 "graphics-processor.c"
				gchar* _tmp22_ = NULL;
				gchar* object = NULL;
#line 29 "/home/jens/Source/shotwell/src/graphics-processor.vala"
				_tmp22_ = g_strdup (object_collection[object_it]);
#line 29 "/home/jens/Source/shotwell/src/graphics-processor.vala"
				object = _tmp22_;
#line 478 "graphics-processor.c"
				{
					gchar** keys = NULL;
					GKeyFile* _tmp23_ = NULL;
					const gchar* _tmp24_ = NULL;
					gsize _tmp25_;
					gchar** _tmp26_ = NULL;
					gint keys_length1 = 0;
					gint _keys_size_ = 0;
					gboolean _tmp27_ = FALSE;
					gchar** _tmp28_ = NULL;
					gint _tmp28__length1 = 0;
					KeyValueMap* key_map = NULL;
					const gchar* _tmp30_ = NULL;
					KeyValueMap* _tmp31_ = NULL;
					gchar** _tmp32_ = NULL;
					gint _tmp32__length1 = 0;
					GeeHashMap* _tmp41_ = NULL;
					const gchar* _tmp42_ = NULL;
					KeyValueMap* _tmp43_ = NULL;
#line 30 "/home/jens/Source/shotwell/src/graphics-processor.vala"
					_tmp23_ = keyfile;
#line 30 "/home/jens/Source/shotwell/src/graphics-processor.vala"
					_tmp24_ = object;
#line 30 "/home/jens/Source/shotwell/src/graphics-processor.vala"
					_tmp26_ = g_key_file_get_keys (_tmp23_, _tmp24_, &_tmp25_, &_inner_error_);
#line 30 "/home/jens/Source/shotwell/src/graphics-processor.vala"
					keys = _tmp26_;
#line 30 "/home/jens/Source/shotwell/src/graphics-processor.vala"
					keys_length1 = _tmp25_;
#line 30 "/home/jens/Source/shotwell/src/graphics-processor.vala"
					_keys_size_ = keys_length1;
#line 30 "/home/jens/Source/shotwell/src/graphics-processor.vala"
					if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 30 "/home/jens/Source/shotwell/src/graphics-processor.vala"
						_g_free0 (object);
#line 30 "/home/jens/Source/shotwell/src/graphics-processor.vala"
						objects = (_vala_array_free (objects, objects_length1, (GDestroyNotify) g_free), NULL);
#line 30 "/home/jens/Source/shotwell/src/graphics-processor.vala"
						_g_object_unref0 (map);
#line 30 "/home/jens/Source/shotwell/src/graphics-processor.vala"
						_g_key_file_unref0 (keyfile);
#line 520 "graphics-processor.c"
						goto __catch0_g_error;
					}
#line 31 "/home/jens/Source/shotwell/src/graphics-processor.vala"
					_tmp28_ = keys;
#line 31 "/home/jens/Source/shotwell/src/graphics-processor.vala"
					_tmp28__length1 = keys_length1;
#line 31 "/home/jens/Source/shotwell/src/graphics-processor.vala"
					if (_tmp28_ == NULL) {
#line 31 "/home/jens/Source/shotwell/src/graphics-processor.vala"
						_tmp27_ = TRUE;
#line 531 "graphics-processor.c"
					} else {
						gchar** _tmp29_ = NULL;
						gint _tmp29__length1 = 0;
#line 31 "/home/jens/Source/shotwell/src/graphics-processor.vala"
						_tmp29_ = keys;
#line 31 "/home/jens/Source/shotwell/src/graphics-processor.vala"
						_tmp29__length1 = keys_length1;
#line 31 "/home/jens/Source/shotwell/src/graphics-processor.vala"
						_tmp27_ = _tmp29__length1 == 0;
#line 541 "graphics-processor.c"
					}
#line 31 "/home/jens/Source/shotwell/src/graphics-processor.vala"
					if (_tmp27_) {
#line 32 "/home/jens/Source/shotwell/src/graphics-processor.vala"
						keys = (_vala_array_free (keys, keys_length1, (GDestroyNotify) g_free), NULL);
#line 32 "/home/jens/Source/shotwell/src/graphics-processor.vala"
						_g_free0 (object);
#line 32 "/home/jens/Source/shotwell/src/graphics-processor.vala"
						continue;
#line 551 "graphics-processor.c"
					}
#line 35 "/home/jens/Source/shotwell/src/graphics-processor.vala"
					_tmp30_ = object;
#line 35 "/home/jens/Source/shotwell/src/graphics-processor.vala"
					_tmp31_ = key_value_map_new (_tmp30_);
#line 35 "/home/jens/Source/shotwell/src/graphics-processor.vala"
					key_map = _tmp31_;
#line 36 "/home/jens/Source/shotwell/src/graphics-processor.vala"
					_tmp32_ = keys;
#line 36 "/home/jens/Source/shotwell/src/graphics-processor.vala"
					_tmp32__length1 = keys_length1;
#line 563 "graphics-processor.c"
					{
						gchar** key_collection = NULL;
						gint key_collection_length1 = 0;
						gint _key_collection_size_ = 0;
						gint key_it = 0;
#line 36 "/home/jens/Source/shotwell/src/graphics-processor.vala"
						key_collection = _tmp32_;
#line 36 "/home/jens/Source/shotwell/src/graphics-processor.vala"
						key_collection_length1 = _tmp32__length1;
#line 36 "/home/jens/Source/shotwell/src/graphics-processor.vala"
						for (key_it = 0; key_it < _tmp32__length1; key_it = key_it + 1) {
#line 575 "graphics-processor.c"
							gchar* _tmp33_ = NULL;
							gchar* key = NULL;
#line 36 "/home/jens/Source/shotwell/src/graphics-processor.vala"
							_tmp33_ = g_strdup (key_collection[key_it]);
#line 36 "/home/jens/Source/shotwell/src/graphics-processor.vala"
							key = _tmp33_;
#line 582 "graphics-processor.c"
							{
								gchar* _tmp34_ = NULL;
								GKeyFile* _tmp35_ = NULL;
								const gchar* _tmp36_ = NULL;
								const gchar* _tmp37_ = NULL;
								gchar* _tmp38_ = NULL;
								KeyValueMap* _tmp39_ = NULL;
								const gchar* _tmp40_ = NULL;
#line 37 "/home/jens/Source/shotwell/src/graphics-processor.vala"
								_tmp35_ = keyfile;
#line 37 "/home/jens/Source/shotwell/src/graphics-processor.vala"
								_tmp36_ = object;
#line 37 "/home/jens/Source/shotwell/src/graphics-processor.vala"
								_tmp37_ = key;
#line 37 "/home/jens/Source/shotwell/src/graphics-processor.vala"
								_tmp38_ = g_key_file_get_string (_tmp35_, _tmp36_, _tmp37_, &_inner_error_);
#line 37 "/home/jens/Source/shotwell/src/graphics-processor.vala"
								_tmp34_ = _tmp38_;
#line 37 "/home/jens/Source/shotwell/src/graphics-processor.vala"
								if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 37 "/home/jens/Source/shotwell/src/graphics-processor.vala"
									_g_free0 (key);
#line 37 "/home/jens/Source/shotwell/src/graphics-processor.vala"
									_key_value_map_unref0 (key_map);
#line 37 "/home/jens/Source/shotwell/src/graphics-processor.vala"
									keys = (_vala_array_free (keys, keys_length1, (GDestroyNotify) g_free), NULL);
#line 37 "/home/jens/Source/shotwell/src/graphics-processor.vala"
									_g_free0 (object);
#line 37 "/home/jens/Source/shotwell/src/graphics-processor.vala"
									objects = (_vala_array_free (objects, objects_length1, (GDestroyNotify) g_free), NULL);
#line 37 "/home/jens/Source/shotwell/src/graphics-processor.vala"
									_g_object_unref0 (map);
#line 37 "/home/jens/Source/shotwell/src/graphics-processor.vala"
									_g_key_file_unref0 (keyfile);
#line 617 "graphics-processor.c"
									goto __catch0_g_error;
								}
#line 37 "/home/jens/Source/shotwell/src/graphics-processor.vala"
								_tmp39_ = key_map;
#line 37 "/home/jens/Source/shotwell/src/graphics-processor.vala"
								_tmp40_ = key;
#line 37 "/home/jens/Source/shotwell/src/graphics-processor.vala"
								key_value_map_set_string (_tmp39_, _tmp40_, _tmp34_);
#line 36 "/home/jens/Source/shotwell/src/graphics-processor.vala"
								_g_free0 (_tmp34_);
#line 36 "/home/jens/Source/shotwell/src/graphics-processor.vala"
								_g_free0 (key);
#line 630 "graphics-processor.c"
							}
						}
					}
#line 39 "/home/jens/Source/shotwell/src/graphics-processor.vala"
					_tmp41_ = map;
#line 39 "/home/jens/Source/shotwell/src/graphics-processor.vala"
					_tmp42_ = object;
#line 39 "/home/jens/Source/shotwell/src/graphics-processor.vala"
					_tmp43_ = key_map;
#line 39 "/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 29 "/home/jens/Source/shotwell/src/graphics-processor.vala"
					_key_value_map_unref0 (key_map);
#line 29 "/home/jens/Source/shotwell/src/graphics-processor.vala"
					keys = (_vala_array_free (keys, keys_length1, (GDestroyNotify) g_free), NULL);
#line 29 "/home/jens/Source/shotwell/src/graphics-processor.vala"
					_g_free0 (object);
#line 648 "graphics-processor.c"
				}
			}
		}
#line 42 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		result = map;
#line 42 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		objects = (_vala_array_free (objects, objects_length1, (GDestroyNotify) g_free), NULL);
#line 42 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_g_key_file_unref0 (keyfile);
#line 42 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		return result;
#line 660 "graphics-processor.c"
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* err = NULL;
		const gchar* _tmp44_ = NULL;
#line 17 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		err = _inner_error_;
#line 17 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_inner_error_ = NULL;
#line 44 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_tmp44_ = err->message;
#line 44 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		g_error ("graphics-processor.vala:44: %s", _tmp44_);
#line 17 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_g_error_free0 (err);
#line 677 "graphics-processor.c"
	}
	__finally0:
#line 17 "/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 17 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	g_clear_error (&_inner_error_);
#line 17 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	return NULL;
#line 686 "graphics-processor.c"
}


gint _vala_main (gchar** args, int args_length1) {
	gint result = 0;
	GOptionContext* ctx = NULL;
	GOptionContext* _tmp0_ = NULL;
	GOptionContext* _tmp1_ = NULL;
	GOptionContext* _tmp2_ = NULL;
	GOptionContext* _tmp3_ = NULL;
	gboolean _tmp9_ = FALSE;
	const gchar* _tmp10_ = NULL;
	gboolean _tmp15_ = FALSE;
	gboolean _tmp16_ = FALSE;
	GdkPixbuf* src = NULL;
	GdkPixbuf* output = NULL;
	GdkPixbuf* _tmp24_ = NULL;
	GdkPixbuf* _tmp25_ = NULL;
	PixelTransformationBundle* adjustments = NULL;
	const gchar* _tmp26_ = NULL;
	gboolean _tmp36_ = FALSE;
	PixelTransformer* transformer = NULL;
	PixelTransformationBundle* _tmp39_ = NULL;
	PixelTransformer* _tmp40_ = NULL;
	GTimer* timer = NULL;
	GTimer* _tmp41_ = NULL;
	PixelTransformer* _tmp42_ = NULL;
	GdkPixbuf* _tmp43_ = NULL;
	GdkPixbuf* _tmp44_ = NULL;
	gdouble elapsed = 0.0;
	GTimer* _tmp45_ = NULL;
	gdouble _tmp46_ = 0.0;
	gdouble _tmp47_ = 0.0;
	const gchar* _tmp48_ = NULL;
	GError * _inner_error_ = NULL;
#line 49 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	_tmp0_ = g_option_context_new ("- Apply shotwell transformations on commandline");
#line 49 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	ctx = _tmp0_;
#line 50 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	_tmp1_ = ctx;
#line 50 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	g_option_context_set_help_enabled (_tmp1_, TRUE);
#line 51 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	_tmp2_ = ctx;
#line 51 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	g_option_context_set_ignore_unknown_options (_tmp2_, TRUE);
#line 52 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	_tmp3_ = ctx;
#line 52 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	g_option_context_add_main_entries (_tmp3_, options, NULL);
#line 738 "graphics-processor.c"
	{
		GOptionContext* _tmp4_ = NULL;
#line 55 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_tmp4_ = ctx;
#line 55 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		g_option_context_parse (_tmp4_, &args_length1, &args, &_inner_error_);
#line 55 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 747 "graphics-processor.c"
			goto __catch2_g_error;
		}
	}
	goto __finally2;
	__catch2_g_error:
	{
		GError* _error_ = NULL;
		GOptionContext* _tmp5_ = NULL;
		gchar* _tmp6_ = NULL;
		gchar* _tmp7_ = NULL;
#line 54 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_error_ = _inner_error_;
#line 54 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_inner_error_ = NULL;
#line 57 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_tmp5_ = ctx;
#line 57 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_tmp6_ = g_option_context_get_help (_tmp5_, TRUE, NULL);
#line 57 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_tmp7_ = _tmp6_;
#line 57 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		g_print ("%s", _tmp7_);
#line 57 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_g_free0 (_tmp7_);
#line 59 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		result = 1;
#line 59 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_g_error_free0 (_error_);
#line 59 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_g_option_context_free0 (ctx);
#line 59 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		return result;
#line 780 "graphics-processor.c"
	}
	__finally2:
#line 54 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 785 "graphics-processor.c"
		gint _tmp8_ = 0;
#line 54 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_g_option_context_free0 (ctx);
#line 54 "/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 54 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		g_clear_error (&_inner_error_);
#line 54 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		return _tmp8_;
#line 795 "graphics-processor.c"
	}
#line 62 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	_tmp10_ = input_file;
#line 62 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	if (_tmp10_ == NULL) {
#line 62 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_tmp9_ = TRUE;
#line 803 "graphics-processor.c"
	} else {
		const gchar* _tmp11_ = NULL;
#line 62 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_tmp11_ = output_file;
#line 62 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_tmp9_ = _tmp11_ == NULL;
#line 810 "graphics-processor.c"
	}
#line 62 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	if (_tmp9_) {
#line 814 "graphics-processor.c"
		GOptionContext* _tmp12_ = NULL;
		gchar* _tmp13_ = NULL;
		gchar* _tmp14_ = NULL;
#line 63 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		g_print ("You need to provide and input and output file\n");
#line 64 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_tmp12_ = ctx;
#line 64 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_tmp13_ = g_option_context_get_help (_tmp12_, TRUE, NULL);
#line 64 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_tmp14_ = _tmp13_;
#line 64 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		g_print ("%s", _tmp14_);
#line 64 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_g_free0 (_tmp14_);
#line 66 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		result = 1;
#line 66 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_g_option_context_free0 (ctx);
#line 66 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		return result;
#line 836 "graphics-processor.c"
	}
#line 69 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	_tmp16_ = auto_enhance;
#line 69 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	if (_tmp16_ == FALSE) {
#line 842 "graphics-processor.c"
		const gchar* _tmp17_ = NULL;
#line 69 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_tmp17_ = pipeline;
#line 69 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_tmp15_ = _tmp17_ == NULL;
#line 848 "graphics-processor.c"
	} else {
#line 69 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_tmp15_ = FALSE;
#line 852 "graphics-processor.c"
	}
#line 69 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	if (_tmp15_) {
#line 70 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		g_print ("No operation provided. Nothing to do.\n");
#line 72 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		result = 0;
#line 72 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_g_option_context_free0 (ctx);
#line 72 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		return result;
#line 864 "graphics-processor.c"
	}
#line 75 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	src = NULL;
#line 868 "graphics-processor.c"
	{
		GdkPixbuf* _tmp18_ = NULL;
		const gchar* _tmp19_ = NULL;
		GdkPixbuf* _tmp20_ = NULL;
		GdkPixbuf* _tmp21_ = NULL;
#line 77 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_tmp19_ = input_file;
#line 77 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_tmp20_ = gdk_pixbuf_new_from_file (_tmp19_, &_inner_error_);
#line 77 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_tmp18_ = _tmp20_;
#line 77 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 882 "graphics-processor.c"
			goto __catch3_g_error;
		}
#line 77 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_tmp21_ = _tmp18_;
#line 77 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_tmp18_ = NULL;
#line 77 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_g_object_unref0 (src);
#line 77 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		src = _tmp21_;
#line 76 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_g_object_unref0 (_tmp18_);
#line 895 "graphics-processor.c"
	}
	goto __finally3;
	__catch3_g_error:
	{
		GError* err = NULL;
		const gchar* _tmp22_ = NULL;
#line 76 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		err = _inner_error_;
#line 76 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_inner_error_ = NULL;
#line 79 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_tmp22_ = err->message;
#line 79 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		g_error ("graphics-processor.vala:79: %s", _tmp22_);
#line 76 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_g_error_free0 (err);
#line 912 "graphics-processor.c"
	}
	__finally3:
#line 76 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 917 "graphics-processor.c"
		gint _tmp23_ = 0;
#line 76 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_g_object_unref0 (src);
#line 76 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_g_option_context_free0 (ctx);
#line 76 "/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 76 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		g_clear_error (&_inner_error_);
#line 76 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		return _tmp23_;
#line 929 "graphics-processor.c"
	}
#line 82 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	_tmp24_ = src;
#line 82 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	_tmp25_ = gdk_pixbuf_copy (_tmp24_);
#line 82 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	output = _tmp25_;
#line 83 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	adjustments = NULL;
#line 85 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	_tmp26_ = pipeline;
#line 85 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	if (_tmp26_ != NULL) {
#line 943 "graphics-processor.c"
		GeeHashMap* transformations = NULL;
		const gchar* _tmp27_ = NULL;
		GeeHashMap* _tmp28_ = NULL;
		PixelTransformationBundle* _tmp29_ = NULL;
		KeyValueMap* map = NULL;
		GeeHashMap* _tmp30_ = NULL;
		gpointer _tmp31_ = NULL;
		KeyValueMap* _tmp32_ = NULL;
#line 86 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_tmp27_ = pipeline;
#line 86 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_tmp28_ = marshall_all_transformations (_tmp27_);
#line 86 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		transformations = _tmp28_;
#line 88 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_tmp29_ = pixel_transformation_bundle_new ();
#line 88 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_pixel_transformation_bundle_unref0 (adjustments);
#line 88 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		adjustments = _tmp29_;
#line 89 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_tmp30_ = transformations;
#line 89 "/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 89 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		map = (KeyValueMap*) _tmp31_;
#line 90 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_tmp32_ = map;
#line 90 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		if (_tmp32_ == NULL) {
#line 974 "graphics-processor.c"
			PixelTransformationBundle* _tmp33_ = NULL;
#line 91 "/home/jens/Source/shotwell/src/graphics-processor.vala"
			_tmp33_ = adjustments;
#line 91 "/home/jens/Source/shotwell/src/graphics-processor.vala"
			pixel_transformation_bundle_set_to_identity (_tmp33_);
#line 980 "graphics-processor.c"
		} else {
			PixelTransformationBundle* _tmp34_ = NULL;
			KeyValueMap* _tmp35_ = NULL;
#line 93 "/home/jens/Source/shotwell/src/graphics-processor.vala"
			_tmp34_ = adjustments;
#line 93 "/home/jens/Source/shotwell/src/graphics-processor.vala"
			_tmp35_ = map;
#line 93 "/home/jens/Source/shotwell/src/graphics-processor.vala"
			pixel_transformation_bundle_load (_tmp34_, _tmp35_);
#line 990 "graphics-processor.c"
		}
#line 85 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_key_value_map_unref0 (map);
#line 85 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_g_object_unref0 (transformations);
#line 996 "graphics-processor.c"
	}
#line 97 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	_tmp36_ = auto_enhance;
#line 97 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	if (_tmp36_) {
#line 1002 "graphics-processor.c"
		GdkPixbuf* _tmp37_ = NULL;
		PixelTransformationBundle* _tmp38_ = NULL;
#line 98 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_tmp37_ = src;
#line 98 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_tmp38_ = auto_enhance_create_auto_enhance_adjustments (_tmp37_);
#line 98 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_pixel_transformation_bundle_unref0 (adjustments);
#line 98 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		adjustments = _tmp38_;
#line 1013 "graphics-processor.c"
	}
#line 101 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	_tmp39_ = adjustments;
#line 101 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	_tmp40_ = pixel_transformation_bundle_generate_transformer (_tmp39_);
#line 101 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	transformer = _tmp40_;
#line 102 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	_tmp41_ = g_timer_new ();
#line 102 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	timer = _tmp41_;
#line 103 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	_tmp42_ = transformer;
#line 103 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	_tmp43_ = src;
#line 103 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	_tmp44_ = output;
#line 103 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	pixel_transformer_transform_to_other_pixbuf (_tmp42_, _tmp43_, _tmp44_, NULL);
#line 104 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	_tmp45_ = timer;
#line 104 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	_tmp46_ = g_timer_elapsed (_tmp45_, NULL);
#line 104 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	elapsed = _tmp46_;
#line 106 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	_tmp47_ = elapsed;
#line 106 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	g_print ("Transformation took %f\n", _tmp47_);
#line 109 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	_tmp48_ = format;
#line 109 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	if (_tmp48_ == NULL) {
#line 1047 "graphics-processor.c"
		gchar* content_type = NULL;
		const gchar* _tmp49_ = NULL;
		gchar* _tmp50_ = NULL;
		const gchar* _tmp51_ = NULL;
		gchar* _tmp53_ = NULL;
#line 110 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_tmp49_ = output_file;
#line 110 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_tmp50_ = g_content_type_guess (_tmp49_, NULL, (gsize) 0, NULL);
#line 110 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		content_type = _tmp50_;
#line 111 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_tmp51_ = content_type;
#line 111 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		if (g_strcmp0 (_tmp51_, "image/png") == 0) {
#line 1063 "graphics-processor.c"
			gchar* _tmp52_ = NULL;
#line 112 "/home/jens/Source/shotwell/src/graphics-processor.vala"
			_tmp52_ = g_strdup ("png");
#line 112 "/home/jens/Source/shotwell/src/graphics-processor.vala"
			_g_free0 (format);
#line 112 "/home/jens/Source/shotwell/src/graphics-processor.vala"
			format = _tmp52_;
#line 1071 "graphics-processor.c"
		}
#line 115 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_tmp53_ = g_strdup ("jpeg");
#line 115 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_g_free0 (format);
#line 115 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		format = _tmp53_;
#line 109 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_g_free0 (content_type);
#line 1081 "graphics-processor.c"
	}
	{
		GdkPixbuf* _tmp54_ = NULL;
		const gchar* _tmp55_ = NULL;
		const gchar* _tmp56_ = NULL;
#line 119 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_tmp54_ = output;
#line 119 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_tmp55_ = output_file;
#line 119 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_tmp56_ = format;
#line 119 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		gdk_pixbuf_save (_tmp54_, _tmp55_, _tmp56_, &_inner_error_, NULL, NULL);
#line 119 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1097 "graphics-processor.c"
			goto __catch4_g_error;
		}
	}
	goto __finally4;
	__catch4_g_error:
	{
		GError* err = NULL;
		const gchar* _tmp57_ = NULL;
#line 118 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		err = _inner_error_;
#line 118 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_inner_error_ = NULL;
#line 121 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_tmp57_ = err->message;
#line 121 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		g_error ("graphics-processor.vala:121: %s", _tmp57_);
#line 118 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_g_error_free0 (err);
#line 1116 "graphics-processor.c"
	}
	__finally4:
#line 118 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1121 "graphics-processor.c"
		gint _tmp58_ = 0;
#line 118 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_g_timer_destroy0 (timer);
#line 118 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_pixel_transformer_unref0 (transformer);
#line 118 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_pixel_transformation_bundle_unref0 (adjustments);
#line 118 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_g_object_unref0 (output);
#line 118 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_g_object_unref0 (src);
#line 118 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		_g_option_context_free0 (ctx);
#line 118 "/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 118 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		g_clear_error (&_inner_error_);
#line 118 "/home/jens/Source/shotwell/src/graphics-processor.vala"
		return _tmp58_;
#line 1141 "graphics-processor.c"
	}
#line 124 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	result = 0;
#line 124 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	_g_timer_destroy0 (timer);
#line 124 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	_pixel_transformer_unref0 (transformer);
#line 124 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	_pixel_transformation_bundle_unref0 (adjustments);
#line 124 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	_g_object_unref0 (output);
#line 124 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	_g_object_unref0 (src);
#line 124 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	_g_option_context_free0 (ctx);
#line 124 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	return result;
#line 1159 "graphics-processor.c"
}


int main (int argc, char ** argv) {
#if !GLIB_CHECK_VERSION (2,32,0)
	g_thread_init (NULL);
#endif
#if !GLIB_CHECK_VERSION (2,35,0)
	g_type_init ();
#endif
#line 48 "/home/jens/Source/shotwell/src/graphics-processor.vala"
	return _vala_main (argv, argc);
#line 1172 "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);
}



