1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
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);
}
|