summaryrefslogtreecommitdiff
path: root/src/camera/GPhoto.c
blob: e482a971a7c2abbc9719ef60c6675c49d6a5f78a (plain)
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
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
/* GPhoto.c generated by valac 0.34.7, the Vala compiler
 * generated from GPhoto.vala, do not modify */

/* Copyright 2016 Software Freedom Conservancy Inc.
 *
 * This software is licensed under the GNU LGPL (version 2.1 or later).
 * See the COPYING file in this distribution.
 */

#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <float.h>
#include <math.h>
#include <gphoto2/gphoto2-context.h>
#include <gphoto.h>
#include <gphoto2/gphoto2-camera.h>
#include <gphoto2/gphoto2-filesys.h>
#include <gphoto2/gphoto2-result.h>
#include <gphoto2/gphoto2-port-result.h>
#include <gphoto2/gphoto2-port-info-list.h>
#include <gio/gio.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gphoto2/gphoto2-file.h>
#include <fcntl.h>
#include <sys/types.h>
#include <errno.h>
#include <gobject/gvaluecollector.h>


#define GP_TYPE_CONTEXT_WRAPPER (gp_context_wrapper_get_type ())
#define GP_CONTEXT_WRAPPER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GP_TYPE_CONTEXT_WRAPPER, GPContextWrapper))
#define GP_CONTEXT_WRAPPER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GP_TYPE_CONTEXT_WRAPPER, GPContextWrapperClass))
#define GP_IS_CONTEXT_WRAPPER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GP_TYPE_CONTEXT_WRAPPER))
#define GP_IS_CONTEXT_WRAPPER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GP_TYPE_CONTEXT_WRAPPER))
#define GP_CONTEXT_WRAPPER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GP_TYPE_CONTEXT_WRAPPER, GPContextWrapperClass))

typedef struct _GPContextWrapper GPContextWrapper;
typedef struct _GPContextWrapperClass GPContextWrapperClass;
typedef struct _GPContextWrapperPrivate GPContextWrapperPrivate;
#define _gp_context_unref0(var) ((var == NULL) ? NULL : (var = (gp_context_unref (var), NULL)))
typedef struct _GPParamSpecContextWrapper GPParamSpecContextWrapper;

#define GP_TYPE_SPIN_IDLE_WRAPPER (gp_spin_idle_wrapper_get_type ())
#define GP_SPIN_IDLE_WRAPPER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GP_TYPE_SPIN_IDLE_WRAPPER, GPSpinIdleWrapper))
#define GP_SPIN_IDLE_WRAPPER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GP_TYPE_SPIN_IDLE_WRAPPER, GPSpinIdleWrapperClass))
#define GP_IS_SPIN_IDLE_WRAPPER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GP_TYPE_SPIN_IDLE_WRAPPER))
#define GP_IS_SPIN_IDLE_WRAPPER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GP_TYPE_SPIN_IDLE_WRAPPER))
#define GP_SPIN_IDLE_WRAPPER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GP_TYPE_SPIN_IDLE_WRAPPER, GPSpinIdleWrapperClass))

typedef struct _GPSpinIdleWrapper GPSpinIdleWrapper;
typedef struct _GPSpinIdleWrapperClass GPSpinIdleWrapperClass;
typedef struct _GPSpinIdleWrapperPrivate GPSpinIdleWrapperPrivate;

#define TYPE_MEDIA_METADATA (media_metadata_get_type ())
#define MEDIA_METADATA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MEDIA_METADATA, MediaMetadata))
#define MEDIA_METADATA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MEDIA_METADATA, MediaMetadataClass))
#define IS_MEDIA_METADATA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MEDIA_METADATA))
#define IS_MEDIA_METADATA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MEDIA_METADATA))
#define MEDIA_METADATA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MEDIA_METADATA, MediaMetadataClass))

typedef struct _MediaMetadata MediaMetadata;
typedef struct _MediaMetadataClass MediaMetadataClass;

#define TYPE_PHOTO_METADATA (photo_metadata_get_type ())
#define PHOTO_METADATA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PHOTO_METADATA, PhotoMetadata))
#define PHOTO_METADATA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PHOTO_METADATA, PhotoMetadataClass))
#define IS_PHOTO_METADATA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PHOTO_METADATA))
#define IS_PHOTO_METADATA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PHOTO_METADATA))
#define PHOTO_METADATA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PHOTO_METADATA, PhotoMetadataClass))

typedef struct _PhotoMetadata PhotoMetadata;
typedef struct _PhotoMetadataClass PhotoMetadataClass;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _media_metadata_unref0(var) ((var == NULL) ? NULL : (var = (media_metadata_unref (var), NULL)))

#define TYPE_PHOTO_PREVIEW (photo_preview_get_type ())
#define PHOTO_PREVIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PHOTO_PREVIEW, PhotoPreview))
#define PHOTO_PREVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PHOTO_PREVIEW, PhotoPreviewClass))
#define IS_PHOTO_PREVIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PHOTO_PREVIEW))
#define IS_PHOTO_PREVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PHOTO_PREVIEW))
#define PHOTO_PREVIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PHOTO_PREVIEW, PhotoPreviewClass))

typedef struct _PhotoPreview PhotoPreview;
typedef struct _PhotoPreviewClass PhotoPreviewClass;
#define _photo_preview_unref0(var) ((var == NULL) ? NULL : (var = (photo_preview_unref (var), NULL)))

#define JPEG_TYPE_MARKER (jpeg_marker_get_type ())
#define _gp_file_unref0(var) ((var == NULL) ? NULL : (var = (gp_file_unref (var), NULL)))

typedef enum  {
	GPHOTO_ERROR_LIBRARY
} GPhotoError;
#define GPHOTO_ERROR gphoto_error_quark ()
struct _GPContextWrapper {
	GTypeInstance parent_instance;
	volatile int ref_count;
	GPContextWrapperPrivate * priv;
	GPContext* context;
};

struct _GPContextWrapperClass {
	GTypeClass parent_class;
	void (*finalize) (GPContextWrapper *self);
	void (*idle) (GPContextWrapper* self);
	void (*error) (GPContextWrapper* self, const gchar* text, void* data);
	void (*status) (GPContextWrapper* self, const gchar* text, void* data);
	void (*message) (GPContextWrapper* self, const gchar* text, void* data);
	void (*progress_start) (GPContextWrapper* self, gfloat current, const gchar* text, void* data);
	void (*progress_update) (GPContextWrapper* self, gfloat current, void* data);
	void (*progress_stop) (GPContextWrapper* self);
};

struct _GPParamSpecContextWrapper {
	GParamSpec parent_instance;
};

struct _GPSpinIdleWrapper {
	GPContextWrapper parent_instance;
	GPSpinIdleWrapperPrivate * priv;
};

struct _GPSpinIdleWrapperClass {
	GPContextWrapperClass parent_class;
};

typedef enum  {
	JPEG_MARKER_INVALID = 0x00,
	JPEG_MARKER_SOI = 0xD8,
	JPEG_MARKER_EOI = 0xD9,
	JPEG_MARKER_APP0 = 0xE0,
	JPEG_MARKER_APP1 = 0xE1
} JpegMarker;


static gpointer gp_context_wrapper_parent_class = NULL;
static gpointer gp_spin_idle_wrapper_parent_class = NULL;

GQuark gphoto_error_quark (void);
gpointer gp_context_wrapper_ref (gpointer instance);
void gp_context_wrapper_unref (gpointer instance);
GParamSpec* gp_param_spec_context_wrapper (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void gp_value_set_context_wrapper (GValue* value, gpointer v_object);
void gp_value_take_context_wrapper (GValue* value, gpointer v_object);
gpointer gp_value_get_context_wrapper (const GValue* value);
GType gp_context_wrapper_get_type (void) G_GNUC_CONST;
enum  {
	GP_CONTEXT_WRAPPER_DUMMY_PROPERTY
};
GPContextWrapper* gp_context_wrapper_new (void);
GPContextWrapper* gp_context_wrapper_construct (GType object_type);
static void gp_context_wrapper_on_idle (GPContextWrapper* self, GPContext* context);
static void _gp_context_wrapper_on_idle_gp_context_idle_func (GPContext* context, gpointer self);
static void gp_context_wrapper_on_error (GPContextWrapper* self, GPContext* context, const gchar* text);
static void _gp_context_wrapper_on_error_gp_context_error_func (GPContext* context, const gchar* text, gpointer self);
static void gp_context_wrapper_on_status (GPContextWrapper* self, GPContext* context, const gchar* text);
static void _gp_context_wrapper_on_status_gp_context_status_func (GPContext* context, const gchar* text, gpointer self);
static void gp_context_wrapper_on_message (GPContextWrapper* self, GPContext* context, const gchar* text);
static void _gp_context_wrapper_on_message_gp_context_message_func (GPContext* context, const gchar* text, gpointer self);
static guint gp_context_wrapper_on_progress_start (GPContextWrapper* self, GPContext* context, gfloat target, const gchar* text);
static guint _gp_context_wrapper_on_progress_start_gp_context_progress_start_func (GPContext* context, gfloat target, const gchar* text, gpointer self);
static void gp_context_wrapper_on_progress_update (GPContextWrapper* self, GPContext* context, guint id, gfloat current);
static void _gp_context_wrapper_on_progress_update_gp_context_progress_update_func (GPContext* context, guint id, gfloat current, gpointer self);
static void gp_context_wrapper_on_progress_stop (GPContextWrapper* self, GPContext* context, guint id);
static void _gp_context_wrapper_on_progress_stop_gp_context_progress_stop_func (GPContext* context, guint id, gpointer self);
void gp_context_wrapper_idle (GPContextWrapper* self);
static void gp_context_wrapper_real_idle (GPContextWrapper* self);
void gp_context_wrapper_error (GPContextWrapper* self, const gchar* text, void* data);
static void gp_context_wrapper_real_error (GPContextWrapper* self, const gchar* text, void* data);
void gp_context_wrapper_status (GPContextWrapper* self, const gchar* text, void* data);
static void gp_context_wrapper_real_status (GPContextWrapper* self, const gchar* text, void* data);
void gp_context_wrapper_message (GPContextWrapper* self, const gchar* text, void* data);
static void gp_context_wrapper_real_message (GPContextWrapper* self, const gchar* text, void* data);
void gp_context_wrapper_progress_start (GPContextWrapper* self, gfloat current, const gchar* text, void* data);
static void gp_context_wrapper_real_progress_start (GPContextWrapper* self, gfloat current, const gchar* text, void* data);
void gp_context_wrapper_progress_update (GPContextWrapper* self, gfloat current, void* data);
static void gp_context_wrapper_real_progress_update (GPContextWrapper* self, gfloat current, void* data);
void gp_context_wrapper_progress_stop (GPContextWrapper* self);
static void gp_context_wrapper_real_progress_stop (GPContextWrapper* self);
static void gp_context_wrapper_finalize (GPContextWrapper* obj);
GType gp_spin_idle_wrapper_get_type (void) G_GNUC_CONST;
enum  {
	GP_SPIN_IDLE_WRAPPER_DUMMY_PROPERTY
};
GPSpinIdleWrapper* gp_spin_idle_wrapper_new (void);
GPSpinIdleWrapper* gp_spin_idle_wrapper_construct (GType object_type);
static void gp_spin_idle_wrapper_real_idle (GPContextWrapper* base);
void spin_event_loop (void);
static void gp_spin_idle_wrapper_real_progress_update (GPContextWrapper* base, gfloat current, void* data);
#define GP_MAX_FILENAME_LENGTH 63
#define GP_MAX_BASEDIR_LENGTH 255
gboolean gp_get_info (GPContext* context, Camera* camera, const gchar* folder, const gchar* filename, CameraFileInfo* info, GError** error);
gpointer media_metadata_ref (gpointer instance);
void media_metadata_unref (gpointer instance);
GParamSpec* param_spec_media_metadata (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_media_metadata (GValue* value, gpointer v_object);
void value_take_media_metadata (GValue* value, gpointer v_object);
gpointer value_get_media_metadata (const GValue* value);
GType media_metadata_get_type (void) G_GNUC_CONST;
GType photo_metadata_get_type (void) G_GNUC_CONST;
PhotoMetadata* gp_get_fallback_metadata (Camera* camera, GPContext* context, const gchar* folder, const gchar* filename);
PhotoMetadata* photo_metadata_new (void);
PhotoMetadata* photo_metadata_construct (GType object_type);
void media_metadata_read_from_file (MediaMetadata* self, GFile* file, GError** error);
GdkPixbuf* gp_load_preview (GPContext* context, Camera* camera, const gchar* folder, const gchar* filename, guint8** raw, int* raw_length1, gsize* raw_length, GError** error);
guint8* gp_load_file_into_buffer (GPContext* context, Camera* camera, const gchar* folder, const gchar* filename, CameraFileType filetype, int* result_length1, GError** error);
guint photo_metadata_get_preview_count (PhotoMetadata* self);
gpointer photo_preview_ref (gpointer instance);
void photo_preview_unref (gpointer instance);
GParamSpec* param_spec_photo_preview (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_photo_preview (GValue* value, gpointer v_object);
void value_take_photo_preview (GValue* value, gpointer v_object);
gpointer value_get_photo_preview (const GValue* value);
GType photo_preview_get_type (void) G_GNUC_CONST;
PhotoPreview* photo_metadata_get_preview (PhotoMetadata* self, guint number);
guint8* photo_preview_flatten (PhotoPreview* self, int* result_length1, GError** error);
#define JPEG_MARKER_PREFIX ((guint8) 0xFF)
GType jpeg_marker_get_type (void) G_GNUC_CONST;
static guint8* _vala_array_dup23 (guint8* self, int length);
#define IMPORT_PREVIEW_MAX_SCALE 128
GdkPixbuf* gp_load_image (GPContext* context, Camera* camera, const gchar* folder, const gchar* filename, GError** error);
GInputStream* gp_load_file_into_stream (GPContext* context, Camera* camera, const gchar* folder, const gchar* filename, CameraFileType filetype, GError** error);
void gp_save_image (GPContext* context, Camera* camera, const gchar* folder, const gchar* filename, GFile* dest_file, GError** error);
PhotoMetadata* gp_load_metadata (GPContext* context, Camera* camera, const gchar* folder, const gchar* filename, GError** error);
void photo_metadata_read_from_app1_segment (PhotoMetadata* self, guint8* buffer, int buffer_length1, gint length, GError** error);
static guint8* _vala_array_dup24 (guint8* self, int length);
void gp_on_mins_destroyed (void* data);
static void _gp_on_mins_destroyed_gdestroy_notify (void* data);
GFile* app_dirs_get_temp_dir (void);


GQuark gphoto_error_quark (void) {
	return g_quark_from_static_string ("gphoto_error-quark");
}


static void _gp_context_wrapper_on_idle_gp_context_idle_func (GPContext* context, gpointer self) {
#line 18 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	gp_context_wrapper_on_idle ((GPContextWrapper*) self, context);
#line 243 "GPhoto.c"
}


static void _gp_context_wrapper_on_error_gp_context_error_func (GPContext* context, const gchar* text, gpointer self) {
#line 19 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	gp_context_wrapper_on_error ((GPContextWrapper*) self, context, text);
#line 250 "GPhoto.c"
}


static void _gp_context_wrapper_on_status_gp_context_status_func (GPContext* context, const gchar* text, gpointer self) {
#line 20 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	gp_context_wrapper_on_status ((GPContextWrapper*) self, context, text);
#line 257 "GPhoto.c"
}


static void _gp_context_wrapper_on_message_gp_context_message_func (GPContext* context, const gchar* text, gpointer self) {
#line 21 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	gp_context_wrapper_on_message ((GPContextWrapper*) self, context, text);
#line 264 "GPhoto.c"
}


static guint _gp_context_wrapper_on_progress_start_gp_context_progress_start_func (GPContext* context, gfloat target, const gchar* text, gpointer self) {
	guint result;
	result = gp_context_wrapper_on_progress_start ((GPContextWrapper*) self, context, target, text);
#line 22 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	return result;
#line 273 "GPhoto.c"
}


static void _gp_context_wrapper_on_progress_update_gp_context_progress_update_func (GPContext* context, guint id, gfloat current, gpointer self) {
#line 22 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	gp_context_wrapper_on_progress_update ((GPContextWrapper*) self, context, id, current);
#line 280 "GPhoto.c"
}


static void _gp_context_wrapper_on_progress_stop_gp_context_progress_stop_func (GPContext* context, guint id, gpointer self) {
#line 22 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	gp_context_wrapper_on_progress_stop ((GPContextWrapper*) self, context, id);
#line 287 "GPhoto.c"
}


GPContextWrapper* gp_context_wrapper_construct (GType object_type) {
	GPContextWrapper* self = NULL;
	GPContext* _tmp0_ = NULL;
	GPContext* _tmp1_ = NULL;
	GPContext* _tmp2_ = NULL;
	GPContext* _tmp3_ = NULL;
	GPContext* _tmp4_ = NULL;
#line 17 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	self = (GPContextWrapper*) g_type_create_instance (object_type);
#line 18 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp0_ = self->context;
#line 18 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	gp_context_set_idle_func (_tmp0_, _gp_context_wrapper_on_idle_gp_context_idle_func, self);
#line 19 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp1_ = self->context;
#line 19 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	gp_context_set_error_func (_tmp1_, _gp_context_wrapper_on_error_gp_context_error_func, self);
#line 20 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp2_ = self->context;
#line 20 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	gp_context_set_status_func (_tmp2_, _gp_context_wrapper_on_status_gp_context_status_func, self);
#line 21 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp3_ = self->context;
#line 21 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	gp_context_set_message_func (_tmp3_, _gp_context_wrapper_on_message_gp_context_message_func, self);
#line 22 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp4_ = self->context;
#line 22 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	gp_context_set_progress_funcs (_tmp4_, _gp_context_wrapper_on_progress_start_gp_context_progress_start_func, _gp_context_wrapper_on_progress_update_gp_context_progress_update_func, _gp_context_wrapper_on_progress_stop_gp_context_progress_stop_func, self);
#line 17 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	return self;
#line 322 "GPhoto.c"
}


GPContextWrapper* gp_context_wrapper_new (void) {
#line 17 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	return gp_context_wrapper_construct (GP_TYPE_CONTEXT_WRAPPER);
#line 329 "GPhoto.c"
}


static void gp_context_wrapper_real_idle (GPContextWrapper* self) {
}


void gp_context_wrapper_idle (GPContextWrapper* self) {
#line 25 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_if_fail (GP_IS_CONTEXT_WRAPPER (self));
#line 25 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	GP_CONTEXT_WRAPPER_GET_CLASS (self)->idle (self);
#line 342 "GPhoto.c"
}


static void gp_context_wrapper_real_error (GPContextWrapper* self, const gchar* text, void* data) {
#line 28 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_if_fail (text != NULL);
#line 349 "GPhoto.c"
}


void gp_context_wrapper_error (GPContextWrapper* self, const gchar* text, void* data) {
#line 28 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_if_fail (GP_IS_CONTEXT_WRAPPER (self));
#line 28 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	GP_CONTEXT_WRAPPER_GET_CLASS (self)->error (self, text, data);
#line 358 "GPhoto.c"
}


static void gp_context_wrapper_real_status (GPContextWrapper* self, const gchar* text, void* data) {
#line 31 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_if_fail (text != NULL);
#line 365 "GPhoto.c"
}


void gp_context_wrapper_status (GPContextWrapper* self, const gchar* text, void* data) {
#line 31 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_if_fail (GP_IS_CONTEXT_WRAPPER (self));
#line 31 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	GP_CONTEXT_WRAPPER_GET_CLASS (self)->status (self, text, data);
#line 374 "GPhoto.c"
}


static void gp_context_wrapper_real_message (GPContextWrapper* self, const gchar* text, void* data) {
#line 34 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_if_fail (text != NULL);
#line 381 "GPhoto.c"
}


void gp_context_wrapper_message (GPContextWrapper* self, const gchar* text, void* data) {
#line 34 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_if_fail (GP_IS_CONTEXT_WRAPPER (self));
#line 34 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	GP_CONTEXT_WRAPPER_GET_CLASS (self)->message (self, text, data);
#line 390 "GPhoto.c"
}


static void gp_context_wrapper_real_progress_start (GPContextWrapper* self, gfloat current, const gchar* text, void* data) {
#line 37 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_if_fail (text != NULL);
#line 397 "GPhoto.c"
}


void gp_context_wrapper_progress_start (GPContextWrapper* self, gfloat current, const gchar* text, void* data) {
#line 37 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_if_fail (GP_IS_CONTEXT_WRAPPER (self));
#line 37 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	GP_CONTEXT_WRAPPER_GET_CLASS (self)->progress_start (self, current, text, data);
#line 406 "GPhoto.c"
}


static void gp_context_wrapper_real_progress_update (GPContextWrapper* self, gfloat current, void* data) {
}


void gp_context_wrapper_progress_update (GPContextWrapper* self, gfloat current, void* data) {
#line 40 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_if_fail (GP_IS_CONTEXT_WRAPPER (self));
#line 40 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	GP_CONTEXT_WRAPPER_GET_CLASS (self)->progress_update (self, current, data);
#line 419 "GPhoto.c"
}


static void gp_context_wrapper_real_progress_stop (GPContextWrapper* self) {
}


void gp_context_wrapper_progress_stop (GPContextWrapper* self) {
#line 43 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_if_fail (GP_IS_CONTEXT_WRAPPER (self));
#line 43 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	GP_CONTEXT_WRAPPER_GET_CLASS (self)->progress_stop (self);
#line 432 "GPhoto.c"
}


static void gp_context_wrapper_on_idle (GPContextWrapper* self, GPContext* context) {
#line 46 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_if_fail (GP_IS_CONTEXT_WRAPPER (self));
#line 46 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_if_fail (context != NULL);
#line 47 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	gp_context_wrapper_idle (self);
#line 443 "GPhoto.c"
}


static void gp_context_wrapper_on_error (GPContextWrapper* self, GPContext* context, const gchar* text) {
	const gchar* _tmp0_ = NULL;
#line 50 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_if_fail (GP_IS_CONTEXT_WRAPPER (self));
#line 50 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_if_fail (context != NULL);
#line 50 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_if_fail (text != NULL);
#line 51 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp0_ = text;
#line 51 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	gp_context_wrapper_error (self, _tmp0_, NULL);
#line 459 "GPhoto.c"
}


static void gp_context_wrapper_on_status (GPContextWrapper* self, GPContext* context, const gchar* text) {
	const gchar* _tmp0_ = NULL;
#line 54 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_if_fail (GP_IS_CONTEXT_WRAPPER (self));
#line 54 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_if_fail (context != NULL);
#line 54 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_if_fail (text != NULL);
#line 55 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp0_ = text;
#line 55 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	gp_context_wrapper_status (self, _tmp0_, NULL);
#line 475 "GPhoto.c"
}


static void gp_context_wrapper_on_message (GPContextWrapper* self, GPContext* context, const gchar* text) {
	const gchar* _tmp0_ = NULL;
#line 58 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_if_fail (GP_IS_CONTEXT_WRAPPER (self));
#line 58 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_if_fail (context != NULL);
#line 58 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_if_fail (text != NULL);
#line 59 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp0_ = text;
#line 59 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	gp_context_wrapper_message (self, _tmp0_, NULL);
#line 491 "GPhoto.c"
}


static guint gp_context_wrapper_on_progress_start (GPContextWrapper* self, GPContext* context, gfloat target, const gchar* text) {
	guint result = 0U;
	gfloat _tmp0_ = 0.0F;
	const gchar* _tmp1_ = NULL;
#line 62 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_val_if_fail (GP_IS_CONTEXT_WRAPPER (self), 0U);
#line 62 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_val_if_fail (context != NULL, 0U);
#line 62 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_val_if_fail (text != NULL, 0U);
#line 63 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp0_ = target;
#line 63 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp1_ = text;
#line 63 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	gp_context_wrapper_progress_start (self, _tmp0_, _tmp1_, NULL);
#line 65 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	result = (guint) 0;
#line 65 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	return result;
#line 515 "GPhoto.c"
}


static void gp_context_wrapper_on_progress_update (GPContextWrapper* self, GPContext* context, guint id, gfloat current) {
	gfloat _tmp0_ = 0.0F;
#line 68 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_if_fail (GP_IS_CONTEXT_WRAPPER (self));
#line 68 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_if_fail (context != NULL);
#line 69 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp0_ = current;
#line 69 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	gp_context_wrapper_progress_update (self, _tmp0_, NULL);
#line 529 "GPhoto.c"
}


static void gp_context_wrapper_on_progress_stop (GPContextWrapper* self, GPContext* context, guint id) {
#line 72 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_if_fail (GP_IS_CONTEXT_WRAPPER (self));
#line 72 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_if_fail (context != NULL);
#line 73 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	gp_context_wrapper_progress_stop (self);
#line 540 "GPhoto.c"
}


static void gp_value_context_wrapper_init (GValue* value) {
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	value->data[0].v_pointer = NULL;
#line 547 "GPhoto.c"
}


static void gp_value_context_wrapper_free_value (GValue* value) {
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	if (value->data[0].v_pointer) {
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		gp_context_wrapper_unref (value->data[0].v_pointer);
#line 556 "GPhoto.c"
	}
}


static void gp_value_context_wrapper_copy_value (const GValue* src_value, GValue* dest_value) {
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	if (src_value->data[0].v_pointer) {
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		dest_value->data[0].v_pointer = gp_context_wrapper_ref (src_value->data[0].v_pointer);
#line 566 "GPhoto.c"
	} else {
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		dest_value->data[0].v_pointer = NULL;
#line 570 "GPhoto.c"
	}
}


static gpointer gp_value_context_wrapper_peek_pointer (const GValue* value) {
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	return value->data[0].v_pointer;
#line 578 "GPhoto.c"
}


static gchar* gp_value_context_wrapper_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	if (collect_values[0].v_pointer) {
#line 585 "GPhoto.c"
		GPContextWrapper* object;
		object = collect_values[0].v_pointer;
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		if (object->parent_instance.g_class == NULL) {
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 592 "GPhoto.c"
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 596 "GPhoto.c"
		}
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		value->data[0].v_pointer = gp_context_wrapper_ref (object);
#line 600 "GPhoto.c"
	} else {
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		value->data[0].v_pointer = NULL;
#line 604 "GPhoto.c"
	}
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	return NULL;
#line 608 "GPhoto.c"
}


static gchar* gp_value_context_wrapper_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	GPContextWrapper** object_p;
	object_p = collect_values[0].v_pointer;
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	if (!object_p) {
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
#line 619 "GPhoto.c"
	}
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	if (!value->data[0].v_pointer) {
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		*object_p = NULL;
#line 625 "GPhoto.c"
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		*object_p = value->data[0].v_pointer;
#line 629 "GPhoto.c"
	} else {
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		*object_p = gp_context_wrapper_ref (value->data[0].v_pointer);
#line 633 "GPhoto.c"
	}
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	return NULL;
#line 637 "GPhoto.c"
}


GParamSpec* gp_param_spec_context_wrapper (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
	GPParamSpecContextWrapper* spec;
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_val_if_fail (g_type_is_a (object_type, GP_TYPE_CONTEXT_WRAPPER), NULL);
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	G_PARAM_SPEC (spec)->value_type = object_type;
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	return G_PARAM_SPEC (spec);
#line 651 "GPhoto.c"
}


gpointer gp_value_get_context_wrapper (const GValue* value) {
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GP_TYPE_CONTEXT_WRAPPER), NULL);
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	return value->data[0].v_pointer;
#line 660 "GPhoto.c"
}


void gp_value_set_context_wrapper (GValue* value, gpointer v_object) {
	GPContextWrapper* old;
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GP_TYPE_CONTEXT_WRAPPER));
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	old = value->data[0].v_pointer;
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	if (v_object) {
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GP_TYPE_CONTEXT_WRAPPER));
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		value->data[0].v_pointer = v_object;
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		gp_context_wrapper_ref (value->data[0].v_pointer);
#line 680 "GPhoto.c"
	} else {
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		value->data[0].v_pointer = NULL;
#line 684 "GPhoto.c"
	}
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	if (old) {
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		gp_context_wrapper_unref (old);
#line 690 "GPhoto.c"
	}
}


void gp_value_take_context_wrapper (GValue* value, gpointer v_object) {
	GPContextWrapper* old;
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GP_TYPE_CONTEXT_WRAPPER));
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	old = value->data[0].v_pointer;
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	if (v_object) {
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GP_TYPE_CONTEXT_WRAPPER));
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		value->data[0].v_pointer = v_object;
#line 709 "GPhoto.c"
	} else {
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		value->data[0].v_pointer = NULL;
#line 713 "GPhoto.c"
	}
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	if (old) {
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		gp_context_wrapper_unref (old);
#line 719 "GPhoto.c"
	}
}


static void gp_context_wrapper_class_init (GPContextWrapperClass * klass) {
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	gp_context_wrapper_parent_class = g_type_class_peek_parent (klass);
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	((GPContextWrapperClass *) klass)->finalize = gp_context_wrapper_finalize;
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	((GPContextWrapperClass *) klass)->idle = (void (*)(GPContextWrapper*)) gp_context_wrapper_real_idle;
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	((GPContextWrapperClass *) klass)->error = (void (*)(GPContextWrapper*, const gchar*, void*)) gp_context_wrapper_real_error;
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	((GPContextWrapperClass *) klass)->status = (void (*)(GPContextWrapper*, const gchar*, void*)) gp_context_wrapper_real_status;
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	((GPContextWrapperClass *) klass)->message = (void (*)(GPContextWrapper*, const gchar*, void*)) gp_context_wrapper_real_message;
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	((GPContextWrapperClass *) klass)->progress_start = (void (*)(GPContextWrapper*, gfloat, const gchar*, void*)) gp_context_wrapper_real_progress_start;
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	((GPContextWrapperClass *) klass)->progress_update = (void (*)(GPContextWrapper*, gfloat, void*)) gp_context_wrapper_real_progress_update;
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	((GPContextWrapperClass *) klass)->progress_stop = (void (*)(GPContextWrapper*)) gp_context_wrapper_real_progress_stop;
#line 743 "GPhoto.c"
}


static void gp_context_wrapper_instance_init (GPContextWrapper * self) {
	GPContext* _tmp0_ = NULL;
#line 15 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp0_ = gp_context_new ();
#line 15 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	self->context = _tmp0_;
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	self->ref_count = 1;
#line 755 "GPhoto.c"
}


static void gp_context_wrapper_finalize (GPContextWrapper* obj) {
	GPContextWrapper * self;
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GP_TYPE_CONTEXT_WRAPPER, GPContextWrapper);
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_signal_handlers_destroy (self);
#line 15 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_gp_context_unref0 (self->context);
#line 767 "GPhoto.c"
}


GType gp_context_wrapper_get_type (void) {
	static volatile gsize gp_context_wrapper_type_id__volatile = 0;
	if (g_once_init_enter (&gp_context_wrapper_type_id__volatile)) {
		static const GTypeValueTable g_define_type_value_table = { gp_value_context_wrapper_init, gp_value_context_wrapper_free_value, gp_value_context_wrapper_copy_value, gp_value_context_wrapper_peek_pointer, "p", gp_value_context_wrapper_collect_value, "p", gp_value_context_wrapper_lcopy_value };
		static const GTypeInfo g_define_type_info = { sizeof (GPContextWrapperClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gp_context_wrapper_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GPContextWrapper), 0, (GInstanceInitFunc) gp_context_wrapper_instance_init, &g_define_type_value_table };
		static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
		GType gp_context_wrapper_type_id;
		gp_context_wrapper_type_id = g_type_register_fundamental (g_type_fundamental_next (), "GPContextWrapper", &g_define_type_info, &g_define_type_fundamental_info, 0);
		g_once_init_leave (&gp_context_wrapper_type_id__volatile, gp_context_wrapper_type_id);
	}
	return gp_context_wrapper_type_id__volatile;
}


gpointer gp_context_wrapper_ref (gpointer instance) {
	GPContextWrapper* self;
	self = instance;
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_atomic_int_inc (&self->ref_count);
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	return instance;
#line 792 "GPhoto.c"
}


void gp_context_wrapper_unref (gpointer instance) {
	GPContextWrapper* self;
	self = instance;
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		GP_CONTEXT_WRAPPER_GET_CLASS (self)->finalize (self);
#line 14 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		g_type_free_instance ((GTypeInstance *) self);
#line 805 "GPhoto.c"
	}
}


GPSpinIdleWrapper* gp_spin_idle_wrapper_construct (GType object_type) {
	GPSpinIdleWrapper* self = NULL;
#line 79 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	self = (GPSpinIdleWrapper*) gp_context_wrapper_construct (object_type);
#line 79 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	return self;
#line 816 "GPhoto.c"
}


GPSpinIdleWrapper* gp_spin_idle_wrapper_new (void) {
#line 79 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	return gp_spin_idle_wrapper_construct (GP_TYPE_SPIN_IDLE_WRAPPER);
#line 823 "GPhoto.c"
}


static void gp_spin_idle_wrapper_real_idle (GPContextWrapper* base) {
	GPSpinIdleWrapper * self;
#line 82 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, GP_TYPE_SPIN_IDLE_WRAPPER, GPSpinIdleWrapper);
#line 83 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	GP_CONTEXT_WRAPPER_CLASS (gp_spin_idle_wrapper_parent_class)->idle (G_TYPE_CHECK_INSTANCE_CAST (self, GP_TYPE_CONTEXT_WRAPPER, GPContextWrapper));
#line 85 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	spin_event_loop ();
#line 835 "GPhoto.c"
}


static void gp_spin_idle_wrapper_real_progress_update (GPContextWrapper* base, gfloat current, void* data) {
	GPSpinIdleWrapper * self;
	gfloat _tmp0_ = 0.0F;
	void* _tmp1_ = NULL;
#line 88 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, GP_TYPE_SPIN_IDLE_WRAPPER, GPSpinIdleWrapper);
#line 89 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp0_ = current;
#line 89 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp1_ = data;
#line 89 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	GP_CONTEXT_WRAPPER_CLASS (gp_spin_idle_wrapper_parent_class)->progress_update (G_TYPE_CHECK_INSTANCE_CAST (self, GP_TYPE_CONTEXT_WRAPPER, GPContextWrapper), _tmp0_, _tmp1_);
#line 91 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	spin_event_loop ();
#line 853 "GPhoto.c"
}


static void gp_spin_idle_wrapper_class_init (GPSpinIdleWrapperClass * klass) {
#line 78 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	gp_spin_idle_wrapper_parent_class = g_type_class_peek_parent (klass);
#line 78 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	((GPContextWrapperClass *) klass)->idle = (void (*)(GPContextWrapper*)) gp_spin_idle_wrapper_real_idle;
#line 78 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	((GPContextWrapperClass *) klass)->progress_update = (void (*)(GPContextWrapper*, gfloat, void*)) gp_spin_idle_wrapper_real_progress_update;
#line 864 "GPhoto.c"
}


static void gp_spin_idle_wrapper_instance_init (GPSpinIdleWrapper * self) {
}


GType gp_spin_idle_wrapper_get_type (void) {
	static volatile gsize gp_spin_idle_wrapper_type_id__volatile = 0;
	if (g_once_init_enter (&gp_spin_idle_wrapper_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (GPSpinIdleWrapperClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gp_spin_idle_wrapper_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GPSpinIdleWrapper), 0, (GInstanceInitFunc) gp_spin_idle_wrapper_instance_init, NULL };
		GType gp_spin_idle_wrapper_type_id;
		gp_spin_idle_wrapper_type_id = g_type_register_static (GP_TYPE_CONTEXT_WRAPPER, "GPSpinIdleWrapper", &g_define_type_info, 0);
		g_once_init_leave (&gp_spin_idle_wrapper_type_id__volatile, gp_spin_idle_wrapper_type_id);
	}
	return gp_spin_idle_wrapper_type_id__volatile;
}


gboolean gp_get_info (GPContext* context, Camera* camera, const gchar* folder, const gchar* filename, CameraFileInfo* info, GError** error) {
	CameraFileInfo _vala_info = {0};
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	const gchar* _tmp1_ = NULL;
	gint _tmp2_ = 0;
	gint _tmp3_ = 0;
	int res = 0;
	Camera* _tmp8_ = NULL;
	const gchar* _tmp9_ = NULL;
	const gchar* _tmp10_ = NULL;
	GPContext* _tmp11_ = NULL;
	CameraFileInfo _tmp12_ = {0};
	int _tmp13_ = 0;
	int _tmp14_ = 0;
	GError * _inner_error_ = NULL;
#line 102 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_val_if_fail (context != NULL, FALSE);
#line 102 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_val_if_fail (camera != NULL, FALSE);
#line 102 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_val_if_fail (folder != NULL, FALSE);
#line 102 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_val_if_fail (filename != NULL, FALSE);
#line 104 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp1_ = folder;
#line 104 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp2_ = strlen (_tmp1_);
#line 104 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp3_ = _tmp2_;
#line 104 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	if (_tmp3_ > GP_MAX_BASEDIR_LENGTH) {
#line 104 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp0_ = TRUE;
#line 918 "GPhoto.c"
	} else {
		const gchar* _tmp4_ = NULL;
		gint _tmp5_ = 0;
		gint _tmp6_ = 0;
#line 104 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp4_ = filename;
#line 104 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp5_ = strlen (_tmp4_);
#line 104 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp6_ = _tmp5_;
#line 104 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp0_ = _tmp6_ > GP_MAX_FILENAME_LENGTH;
#line 931 "GPhoto.c"
	}
#line 104 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	if (_tmp0_) {
#line 935 "GPhoto.c"
		CameraFileInfo _tmp7_ = {0};
#line 105 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		 (_vala_info);
#line 105 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_vala_info = _tmp7_;
#line 107 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		result = FALSE;
#line 107 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		if (info) {
#line 107 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
			*info = _vala_info;
#line 947 "GPhoto.c"
		} else {
#line 107 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
			 (_vala_info);
#line 951 "GPhoto.c"
		}
#line 107 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		return result;
#line 955 "GPhoto.c"
	}
#line 110 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp8_ = camera;
#line 110 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp9_ = folder;
#line 110 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp10_ = filename;
#line 110 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp11_ = context;
#line 110 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp13_ = gp_camera_file_get_info (_tmp8_, _tmp9_, _tmp10_, &_tmp12_, _tmp11_);
#line 110 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	 (_vala_info);
#line 110 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_vala_info = _tmp12_;
#line 110 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	res = _tmp13_;
#line 111 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp14_ = res;
#line 111 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	if (_tmp14_ != GP_OK) {
#line 977 "GPhoto.c"
		int _tmp15_ = 0;
		const gchar* _tmp16_ = NULL;
		const gchar* _tmp17_ = NULL;
		int _tmp18_ = 0;
		const gchar* _tmp19_ = NULL;
		GError* _tmp20_ = NULL;
		gboolean _tmp21_ = FALSE;
#line 112 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp15_ = res;
#line 112 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp16_ = folder;
#line 112 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp17_ = filename;
#line 112 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp18_ = res;
#line 112 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp19_ = gp_port_result_as_string (_tmp18_);
#line 112 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp20_ = g_error_new (GPHOTO_ERROR, GPHOTO_ERROR_LIBRARY, "[%d] Error retrieving file information for %s/%s: %s", (gint) _tmp15_, _tmp16_, _tmp17_, _tmp19_);
#line 112 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_inner_error_ = _tmp20_;
#line 112 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		g_propagate_error (error, _inner_error_);
#line 112 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		return _tmp21_;
#line 1003 "GPhoto.c"
	}
#line 115 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	result = TRUE;
#line 115 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	if (info) {
#line 115 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		*info = _vala_info;
#line 1011 "GPhoto.c"
	} else {
#line 115 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		 (_vala_info);
#line 1015 "GPhoto.c"
	}
#line 115 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	return result;
#line 1019 "GPhoto.c"
}


static gchar* string_slice (const gchar* self, glong start, glong end) {
	gchar* result = NULL;
	glong string_length = 0L;
	gint _tmp0_ = 0;
	gint _tmp1_ = 0;
	glong _tmp2_ = 0L;
	glong _tmp5_ = 0L;
	gboolean _tmp8_ = FALSE;
	glong _tmp9_ = 0L;
	gboolean _tmp12_ = FALSE;
	glong _tmp13_ = 0L;
	glong _tmp16_ = 0L;
	glong _tmp17_ = 0L;
	glong _tmp18_ = 0L;
	glong _tmp19_ = 0L;
	glong _tmp20_ = 0L;
	gchar* _tmp21_ = NULL;
#line 1328 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, NULL);
#line 1329 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp0_ = strlen (self);
#line 1329 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp1_ = _tmp0_;
#line 1329 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	string_length = (glong) _tmp1_;
#line 1330 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp2_ = start;
#line 1330 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	if (_tmp2_ < ((glong) 0)) {
#line 1052 "GPhoto.c"
		glong _tmp3_ = 0L;
		glong _tmp4_ = 0L;
#line 1331 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp3_ = string_length;
#line 1331 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp4_ = start;
#line 1331 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		start = _tmp3_ + _tmp4_;
#line 1061 "GPhoto.c"
	}
#line 1333 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp5_ = end;
#line 1333 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	if (_tmp5_ < ((glong) 0)) {
#line 1067 "GPhoto.c"
		glong _tmp6_ = 0L;
		glong _tmp7_ = 0L;
#line 1334 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp6_ = string_length;
#line 1334 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp7_ = end;
#line 1334 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		end = _tmp6_ + _tmp7_;
#line 1076 "GPhoto.c"
	}
#line 1336 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp9_ = start;
#line 1336 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	if (_tmp9_ >= ((glong) 0)) {
#line 1082 "GPhoto.c"
		glong _tmp10_ = 0L;
		glong _tmp11_ = 0L;
#line 1336 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp10_ = start;
#line 1336 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp11_ = string_length;
#line 1336 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp8_ = _tmp10_ <= _tmp11_;
#line 1091 "GPhoto.c"
	} else {
#line 1336 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp8_ = FALSE;
#line 1095 "GPhoto.c"
	}
#line 1336 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	g_return_val_if_fail (_tmp8_, NULL);
#line 1337 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp13_ = end;
#line 1337 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	if (_tmp13_ >= ((glong) 0)) {
#line 1103 "GPhoto.c"
		glong _tmp14_ = 0L;
		glong _tmp15_ = 0L;
#line 1337 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp14_ = end;
#line 1337 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp15_ = string_length;
#line 1337 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp12_ = _tmp14_ <= _tmp15_;
#line 1112 "GPhoto.c"
	} else {
#line 1337 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp12_ = FALSE;
#line 1116 "GPhoto.c"
	}
#line 1337 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	g_return_val_if_fail (_tmp12_, NULL);
#line 1338 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp16_ = start;
#line 1338 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp17_ = end;
#line 1338 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	g_return_val_if_fail (_tmp16_ <= _tmp17_, NULL);
#line 1339 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp18_ = start;
#line 1339 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp19_ = end;
#line 1339 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp20_ = start;
#line 1339 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	_tmp21_ = g_strndup (((gchar*) self) + _tmp18_, (gsize) (_tmp19_ - _tmp20_));
#line 1339 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	result = _tmp21_;
#line 1339 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	return result;
#line 1138 "GPhoto.c"
}


PhotoMetadata* gp_get_fallback_metadata (Camera* camera, GPContext* context, const gchar* folder, const gchar* filename) {
	PhotoMetadata* result = NULL;
	CameraStorageInformation* sifs = NULL;
	gint count = 0;
	Camera* _tmp0_ = NULL;
	GPContext* _tmp1_ = NULL;
	gint _tmp2_ = 0;
	GPPortInfo port_info = {0};
	Camera* _tmp3_ = NULL;
	GPPortInfo _tmp4_ = {0};
	gchar* path = NULL;
	const gchar* _tmp5_ = NULL;
	gchar* _tmp6_ = NULL;
	gchar* prefix = NULL;
	gchar* _tmp7_ = NULL;
	const gchar* _tmp8_ = NULL;
	gboolean _tmp9_ = FALSE;
	PhotoMetadata* metadata = NULL;
	PhotoMetadata* _tmp17_ = NULL;
	GError * _inner_error_ = NULL;
#line 121 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_val_if_fail (camera != NULL, NULL);
#line 121 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_val_if_fail (context != NULL, NULL);
#line 121 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_val_if_fail (folder != NULL, NULL);
#line 121 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_val_if_fail (filename != NULL, NULL);
#line 122 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	sifs = NULL;
#line 123 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	count = 0;
#line 124 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp0_ = camera;
#line 124 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp1_ = context;
#line 124 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	gp_camera_get_storageinfo (_tmp0_, &sifs, &_tmp2_, _tmp1_);
#line 124 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	count = _tmp2_;
#line 127 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp3_ = camera;
#line 127 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	gp_camera_get_port_info (_tmp3_, &_tmp4_);
#line 127 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	 (port_info);
#line 127 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	port_info = _tmp4_;
#line 130 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	gp_port_info_get_path (port_info, &_tmp5_);
#line 130 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_g_free0 (path);
#line 130 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp6_ = g_strdup (_tmp5_);
#line 130 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	path = _tmp6_;
#line 132 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp7_ = g_strdup ("disk:");
#line 132 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	prefix = _tmp7_;
#line 133 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp8_ = path;
#line 133 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp9_ = g_str_has_prefix (_tmp8_, prefix);
#line 133 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	if (_tmp9_) {
#line 1208 "GPhoto.c"
		const gchar* _tmp10_ = NULL;
		gint _tmp11_ = 0;
		gint _tmp12_ = 0;
		const gchar* _tmp13_ = NULL;
		gint _tmp14_ = 0;
		gint _tmp15_ = 0;
		gchar* _tmp16_ = NULL;
#line 134 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp10_ = path;
#line 134 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp11_ = strlen (prefix);
#line 134 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp12_ = _tmp11_;
#line 134 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp13_ = path;
#line 134 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp14_ = strlen (_tmp13_);
#line 134 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp15_ = _tmp14_;
#line 134 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp16_ = string_slice (_tmp10_, (glong) _tmp12_, (glong) _tmp15_);
#line 134 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_g_free0 (path);
#line 134 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		path = _tmp16_;
#line 1234 "GPhoto.c"
	} else {
#line 136 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		result = NULL;
#line 136 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_g_free0 (prefix);
#line 136 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_g_free0 (path);
#line 136 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		 (port_info);
#line 136 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		return result;
#line 1246 "GPhoto.c"
	}
#line 138 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp17_ = photo_metadata_new ();
#line 138 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	metadata = _tmp17_;
#line 1252 "GPhoto.c"
	{
		PhotoMetadata* _tmp18_ = NULL;
		const gchar* _tmp19_ = NULL;
		const gchar* _tmp20_ = NULL;
		gchar* _tmp21_ = NULL;
		gchar* _tmp22_ = NULL;
		gchar* _tmp23_ = NULL;
		gchar* _tmp24_ = NULL;
		const gchar* _tmp25_ = NULL;
		gchar* _tmp26_ = NULL;
		gchar* _tmp27_ = NULL;
		GFile* _tmp28_ = NULL;
		GFile* _tmp29_ = NULL;
#line 140 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp18_ = metadata;
#line 140 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp19_ = path;
#line 140 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp20_ = folder;
#line 140 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp21_ = g_strconcat (_tmp19_, _tmp20_, NULL);
#line 140 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp22_ = _tmp21_;
#line 140 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp23_ = g_strconcat (_tmp22_, "/", NULL);
#line 140 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp24_ = _tmp23_;
#line 140 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp25_ = filename;
#line 140 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp26_ = g_strconcat (_tmp24_, _tmp25_, NULL);
#line 140 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp27_ = _tmp26_;
#line 140 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp28_ = g_file_new_for_path (_tmp27_);
#line 140 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp29_ = _tmp28_;
#line 140 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		media_metadata_read_from_file (G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, TYPE_MEDIA_METADATA, MediaMetadata), _tmp29_, &_inner_error_);
#line 140 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_g_object_unref0 (_tmp29_);
#line 140 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_g_free0 (_tmp27_);
#line 140 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_g_free0 (_tmp24_);
#line 140 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_g_free0 (_tmp22_);
#line 140 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1302 "GPhoto.c"
			goto __catch61_g_error;
		}
	}
	goto __finally61;
	__catch61_g_error:
	{
#line 139 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		g_clear_error (&_inner_error_);
#line 139 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_inner_error_ = NULL;
#line 142 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_media_metadata_unref0 (metadata);
#line 142 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		metadata = NULL;
#line 1317 "GPhoto.c"
	}
	__finally61:
#line 139 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 139 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_media_metadata_unref0 (metadata);
#line 139 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_g_free0 (prefix);
#line 139 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_g_free0 (path);
#line 139 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		 (port_info);
#line 139 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 139 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		g_clear_error (&_inner_error_);
#line 139 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		return NULL;
#line 1336 "GPhoto.c"
	}
#line 145 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	result = metadata;
#line 145 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_g_free0 (prefix);
#line 145 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_g_free0 (path);
#line 145 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	 (port_info);
#line 145 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	return result;
#line 1348 "GPhoto.c"
}


static guint8* _vala_array_dup23 (guint8* self, int length) {
#line 186 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	return g_memdup (self, length * sizeof (guint8));
#line 1355 "GPhoto.c"
}


GdkPixbuf* gp_load_preview (GPContext* context, Camera* camera, const gchar* folder, const gchar* filename, guint8** raw, int* raw_length1, gsize* raw_length, GError** error) {
	guint8* _vala_raw = NULL;
	int _vala_raw_length1 = 0;
	gsize _vala_raw_length = 0UL;
	GdkPixbuf* result = NULL;
	guint8* _tmp25_ = NULL;
	gint _tmp25__length1 = 0;
	guint8* _tmp26_ = NULL;
	gint _tmp26__length1 = 0;
	gsize _tmp27_ = 0UL;
	GMemoryInputStream* mins = NULL;
	guint8* _tmp42_ = NULL;
	gint _tmp42__length1 = 0;
	guint8* _tmp43_ = NULL;
	gint _tmp43__length1 = 0;
	GMemoryInputStream* _tmp44_ = NULL;
	GdkPixbuf* _tmp45_ = NULL;
	GMemoryInputStream* _tmp46_ = NULL;
	GdkPixbuf* _tmp47_ = NULL;
	GdkPixbuf* _tmp48_ = NULL;
	GError * _inner_error_ = NULL;
#line 148 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_val_if_fail (context != NULL, NULL);
#line 148 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_val_if_fail (camera != NULL, NULL);
#line 148 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_val_if_fail (folder != NULL, NULL);
#line 148 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_val_if_fail (filename != NULL, NULL);
#line 150 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_vala_raw = (g_free (_vala_raw), NULL);
#line 150 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_vala_raw = NULL;
#line 150 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_vala_raw_length1 = 0;
#line 151 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_vala_raw_length = (gsize) 0;
#line 1396 "GPhoto.c"
	{
		guint8* _tmp0_ = NULL;
		GPContext* _tmp1_ = NULL;
		Camera* _tmp2_ = NULL;
		const gchar* _tmp3_ = NULL;
		const gchar* _tmp4_ = NULL;
		gint _tmp5_ = 0;
		guint8* _tmp6_ = NULL;
		gint _tmp0__length1 = 0;
		gint __tmp0__size_ = 0;
		guint8* _tmp7_ = NULL;
		gint _tmp7__length1 = 0;
#line 154 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp1_ = context;
#line 154 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp2_ = camera;
#line 154 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp3_ = folder;
#line 154 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp4_ = filename;
#line 154 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp6_ = gp_load_file_into_buffer (_tmp1_, _tmp2_, _tmp3_, _tmp4_, GP_FILE_TYPE_PREVIEW, &_tmp5_, &_inner_error_);
#line 154 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp0_ = _tmp6_;
#line 154 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp0__length1 = _tmp5_;
#line 154 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		__tmp0__size_ = _tmp0__length1;
#line 154 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1427 "GPhoto.c"
			goto __catch62_g_error;
		}
#line 154 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp7_ = _tmp0_;
#line 154 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp7__length1 = _tmp0__length1;
#line 154 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp0_ = NULL;
#line 154 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp0__length1 = 0;
#line 154 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_vala_raw = (g_free (_vala_raw), NULL);
#line 154 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_vala_raw = _tmp7_;
#line 154 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_vala_raw_length1 = _tmp7__length1;
#line 153 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp0_ = (g_free (_tmp0_), NULL);
#line 1446 "GPhoto.c"
	}
	goto __finally62;
	__catch62_g_error:
	{
		PhotoMetadata* metadata = NULL;
		Camera* _tmp8_ = NULL;
		GPContext* _tmp9_ = NULL;
		const gchar* _tmp10_ = NULL;
		const gchar* _tmp11_ = NULL;
		PhotoMetadata* _tmp12_ = NULL;
		PhotoMetadata* _tmp13_ = NULL;
		PhotoMetadata* _tmp14_ = NULL;
		guint _tmp15_ = 0U;
		PhotoPreview* preview = NULL;
		PhotoMetadata* _tmp16_ = NULL;
		PhotoMetadata* _tmp17_ = NULL;
		guint _tmp18_ = 0U;
		PhotoPreview* _tmp19_ = NULL;
		guint8* _tmp20_ = NULL;
		PhotoPreview* _tmp21_ = NULL;
		gint _tmp22_ = 0;
		guint8* _tmp23_ = NULL;
		gint _tmp20__length1 = 0;
		gint __tmp20__size_ = 0;
		guint8* _tmp24_ = NULL;
		gint _tmp24__length1 = 0;
#line 153 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		g_clear_error (&_inner_error_);
#line 153 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_inner_error_ = NULL;
#line 156 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp8_ = camera;
#line 156 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp9_ = context;
#line 156 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp10_ = folder;
#line 156 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp11_ = filename;
#line 156 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp12_ = gp_get_fallback_metadata (_tmp8_, _tmp9_, _tmp10_, _tmp11_);
#line 156 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		metadata = _tmp12_;
#line 157 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp13_ = metadata;
#line 157 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		if (NULL == _tmp13_) {
#line 158 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
			result = NULL;
#line 158 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
			_media_metadata_unref0 (metadata);
#line 158 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
			if (raw) {
#line 158 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
				*raw = _vala_raw;
#line 1501 "GPhoto.c"
			} else {
#line 158 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
				_vala_raw = (g_free (_vala_raw), NULL);
#line 1505 "GPhoto.c"
			}
#line 158 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
			if (raw_length1) {
#line 158 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
				*raw_length1 = _vala_raw_length1;
#line 1511 "GPhoto.c"
			}
#line 158 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
			if (raw_length) {
#line 158 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
				*raw_length = _vala_raw_length;
#line 1517 "GPhoto.c"
			}
#line 158 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
			return result;
#line 1521 "GPhoto.c"
		}
#line 159 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp14_ = metadata;
#line 159 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp15_ = photo_metadata_get_preview_count (_tmp14_);
#line 159 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		if (((guint) 0) == _tmp15_) {
#line 160 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
			result = NULL;
#line 160 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
			_media_metadata_unref0 (metadata);
#line 160 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
			if (raw) {
#line 160 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
				*raw = _vala_raw;
#line 1537 "GPhoto.c"
			} else {
#line 160 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
				_vala_raw = (g_free (_vala_raw), NULL);
#line 1541 "GPhoto.c"
			}
#line 160 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
			if (raw_length1) {
#line 160 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
				*raw_length1 = _vala_raw_length1;
#line 1547 "GPhoto.c"
			}
#line 160 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
			if (raw_length) {
#line 160 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
				*raw_length = _vala_raw_length;
#line 1553 "GPhoto.c"
			}
#line 160 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
			return result;
#line 1557 "GPhoto.c"
		}
#line 161 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp16_ = metadata;
#line 161 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp17_ = metadata;
#line 161 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp18_ = photo_metadata_get_preview_count (_tmp17_);
#line 161 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp19_ = photo_metadata_get_preview (_tmp16_, _tmp18_ - 1);
#line 161 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		preview = _tmp19_;
#line 162 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp21_ = preview;
#line 162 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp23_ = photo_preview_flatten (_tmp21_, &_tmp22_, &_inner_error_);
#line 162 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp20_ = _tmp23_;
#line 162 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp20__length1 = _tmp22_;
#line 162 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		__tmp20__size_ = _tmp20__length1;
#line 162 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 162 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
			_photo_preview_unref0 (preview);
#line 162 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
			_media_metadata_unref0 (metadata);
#line 1585 "GPhoto.c"
			goto __finally62;
		}
#line 162 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp24_ = _tmp20_;
#line 162 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp24__length1 = _tmp20__length1;
#line 162 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp20_ = NULL;
#line 162 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp20__length1 = 0;
#line 162 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_vala_raw = (g_free (_vala_raw), NULL);
#line 162 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_vala_raw = _tmp24_;
#line 162 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_vala_raw_length1 = _tmp24__length1;
#line 153 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp20_ = (g_free (_tmp20_), NULL);
#line 153 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_photo_preview_unref0 (preview);
#line 153 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_media_metadata_unref0 (metadata);
#line 1608 "GPhoto.c"
	}
	__finally62:
#line 153 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 153 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		g_propagate_error (error, _inner_error_);
#line 153 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		return NULL;
#line 1617 "GPhoto.c"
	}
#line 165 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp25_ = _vala_raw;
#line 165 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp25__length1 = _vala_raw_length1;
#line 165 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	if (_tmp25_ == NULL) {
#line 166 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_vala_raw_length = (gsize) 0;
#line 167 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		result = NULL;
#line 167 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		if (raw) {
#line 167 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
			*raw = _vala_raw;
#line 1633 "GPhoto.c"
		} else {
#line 167 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
			_vala_raw = (g_free (_vala_raw), NULL);
#line 1637 "GPhoto.c"
		}
#line 167 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		if (raw_length1) {
#line 167 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
			*raw_length1 = _vala_raw_length1;
#line 1643 "GPhoto.c"
		}
#line 167 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		if (raw_length) {
#line 167 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
			*raw_length = _vala_raw_length;
#line 1649 "GPhoto.c"
		}
#line 167 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		return result;
#line 1653 "GPhoto.c"
	}
#line 170 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp26_ = _vala_raw;
#line 170 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp26__length1 = _vala_raw_length1;
#line 170 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_vala_raw_length = (gsize) _tmp26__length1;
#line 176 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp27_ = _vala_raw_length;
#line 176 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	if (_tmp27_ > ((gsize) 32)) {
#line 1665 "GPhoto.c"
		{
			gsize i = 0UL;
			gsize _tmp28_ = 0UL;
#line 177 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
			_tmp28_ = _vala_raw_length;
#line 177 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
			i = _tmp28_ - 2;
#line 1673 "GPhoto.c"
			{
				gboolean _tmp29_ = FALSE;
#line 177 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
				_tmp29_ = TRUE;
#line 177 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
				while (TRUE) {
#line 1680 "GPhoto.c"
					gsize _tmp31_ = 0UL;
					gsize _tmp32_ = 0UL;
					gboolean _tmp33_ = FALSE;
					guint8* _tmp34_ = NULL;
					gint _tmp34__length1 = 0;
					gsize _tmp35_ = 0UL;
					guint8 _tmp36_ = 0U;
#line 177 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
					if (!_tmp29_) {
#line 1690 "GPhoto.c"
						gsize _tmp30_ = 0UL;
#line 177 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
						_tmp30_ = i;
#line 177 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
						i = _tmp30_ - 1;
#line 1696 "GPhoto.c"
					}
#line 177 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
					_tmp29_ = FALSE;
#line 177 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
					_tmp31_ = i;
#line 177 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
					_tmp32_ = _vala_raw_length;
#line 177 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
					if (!(_tmp31_ > (_tmp32_ - 32))) {
#line 177 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
						break;
#line 1708 "GPhoto.c"
					}
#line 178 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
					_tmp34_ = _vala_raw;
#line 178 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
					_tmp34__length1 = _vala_raw_length1;
#line 178 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
					_tmp35_ = i;
#line 178 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
					_tmp36_ = _tmp34_[_tmp35_];
#line 178 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
					if (_tmp36_ == JPEG_MARKER_PREFIX) {
#line 1720 "GPhoto.c"
						guint8* _tmp37_ = NULL;
						gint _tmp37__length1 = 0;
						gsize _tmp38_ = 0UL;
						guint8 _tmp39_ = 0U;
#line 178 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
						_tmp37_ = _vala_raw;
#line 178 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
						_tmp37__length1 = _vala_raw_length1;
#line 178 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
						_tmp38_ = i;
#line 178 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
						_tmp39_ = _tmp37_[_tmp38_ + 1];
#line 178 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
						_tmp33_ = _tmp39_ == JPEG_MARKER_EOI;
#line 1735 "GPhoto.c"
					} else {
#line 178 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
						_tmp33_ = FALSE;
#line 1739 "GPhoto.c"
					}
#line 178 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
					if (_tmp33_) {
#line 1743 "GPhoto.c"
						const gchar* _tmp40_ = NULL;
						gsize _tmp41_ = 0UL;
#line 179 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
						_tmp40_ = filename;
#line 179 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
						g_debug ("GPhoto.vala:179: Adjusted length of thumbnail for: %s", _tmp40_);
#line 180 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
						_tmp41_ = i;
#line 180 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
						_vala_raw_length = _tmp41_ + 2;
#line 181 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
						break;
#line 1756 "GPhoto.c"
					}
				}
			}
		}
	}
#line 186 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp42_ = _vala_raw;
#line 186 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp42__length1 = _vala_raw_length1;
#line 186 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp43_ = (_tmp42_ != NULL) ? _vala_array_dup23 (_tmp42_, _tmp42__length1) : ((gpointer) _tmp42_);
#line 186 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp43__length1 = _tmp42__length1;
#line 186 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp44_ = (GMemoryInputStream*) g_memory_input_stream_new_from_data (_tmp43_, _tmp43__length1, NULL);
#line 186 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	mins = _tmp44_;
#line 187 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp46_ = mins;
#line 187 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp47_ = gdk_pixbuf_new_from_stream_at_scale (G_TYPE_CHECK_INSTANCE_CAST (_tmp46_, g_input_stream_get_type (), GInputStream), IMPORT_PREVIEW_MAX_SCALE, IMPORT_PREVIEW_MAX_SCALE, TRUE, NULL, &_inner_error_);
#line 187 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp45_ = _tmp47_;
#line 187 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 187 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		g_propagate_error (error, _inner_error_);
#line 187 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_g_object_unref0 (mins);
#line 187 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		return NULL;
#line 1788 "GPhoto.c"
	}
#line 187 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp48_ = _tmp45_;
#line 187 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp45_ = NULL;
#line 187 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	result = _tmp48_;
#line 187 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_g_object_unref0 (_tmp45_);
#line 187 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_g_object_unref0 (mins);
#line 187 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	if (raw) {
#line 187 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		*raw = _vala_raw;
#line 1804 "GPhoto.c"
	} else {
#line 187 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_vala_raw = (g_free (_vala_raw), NULL);
#line 1808 "GPhoto.c"
	}
#line 187 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	if (raw_length1) {
#line 187 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		*raw_length1 = _vala_raw_length1;
#line 1814 "GPhoto.c"
	}
#line 187 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	if (raw_length) {
#line 187 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		*raw_length = _vala_raw_length;
#line 1820 "GPhoto.c"
	}
#line 187 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	return result;
#line 1824 "GPhoto.c"
}


GdkPixbuf* gp_load_image (GPContext* context, Camera* camera, const gchar* folder, const gchar* filename, GError** error) {
	GdkPixbuf* result = NULL;
	GInputStream* ins = NULL;
	GPContext* _tmp0_ = NULL;
	Camera* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	const gchar* _tmp3_ = NULL;
	GInputStream* _tmp4_ = NULL;
	GInputStream* _tmp5_ = NULL;
	GdkPixbuf* _tmp6_ = NULL;
	GInputStream* _tmp7_ = NULL;
	GdkPixbuf* _tmp8_ = NULL;
	GdkPixbuf* _tmp9_ = NULL;
	GError * _inner_error_ = NULL;
#line 190 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_val_if_fail (context != NULL, NULL);
#line 190 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_val_if_fail (camera != NULL, NULL);
#line 190 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_val_if_fail (folder != NULL, NULL);
#line 190 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_val_if_fail (filename != NULL, NULL);
#line 192 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp0_ = context;
#line 192 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp1_ = camera;
#line 192 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp2_ = folder;
#line 192 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp3_ = filename;
#line 192 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp4_ = gp_load_file_into_stream (_tmp0_, _tmp1_, _tmp2_, _tmp3_, GP_FILE_TYPE_NORMAL, &_inner_error_);
#line 192 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	ins = _tmp4_;
#line 192 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 192 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		g_propagate_error (error, _inner_error_);
#line 192 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		return NULL;
#line 1868 "GPhoto.c"
	}
#line 193 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp5_ = ins;
#line 193 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	if (_tmp5_ == NULL) {
#line 194 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		result = NULL;
#line 194 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_g_object_unref0 (ins);
#line 194 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		return result;
#line 1880 "GPhoto.c"
	}
#line 196 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp7_ = ins;
#line 196 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp8_ = gdk_pixbuf_new_from_stream (_tmp7_, NULL, &_inner_error_);
#line 196 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp6_ = _tmp8_;
#line 196 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 196 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		g_propagate_error (error, _inner_error_);
#line 196 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_g_object_unref0 (ins);
#line 196 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		return NULL;
#line 1896 "GPhoto.c"
	}
#line 196 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp9_ = _tmp6_;
#line 196 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp6_ = NULL;
#line 196 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	result = _tmp9_;
#line 196 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_g_object_unref0 (_tmp6_);
#line 196 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_g_object_unref0 (ins);
#line 196 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	return result;
#line 1910 "GPhoto.c"
}


void gp_save_image (GPContext* context, Camera* camera, const gchar* folder, const gchar* filename, GFile* dest_file, GError** error) {
	gint fd = 0;
	GFile* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	gint _tmp3_ = 0;
	gint _tmp4_ = 0;
	gint _tmp5_ = 0;
	CameraFile* camera_file = NULL;
	int res = 0;
	gint _tmp12_ = 0;
	CameraFile* _tmp13_ = NULL;
	int _tmp14_ = 0;
	int _tmp15_ = 0;
	Camera* _tmp20_ = NULL;
	const gchar* _tmp21_ = NULL;
	const gchar* _tmp22_ = NULL;
	CameraFile* _tmp23_ = NULL;
	GPContext* _tmp24_ = NULL;
	int _tmp25_ = 0;
	int _tmp26_ = 0;
	GError * _inner_error_ = NULL;
#line 199 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_if_fail (context != NULL);
#line 199 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_if_fail (camera != NULL);
#line 199 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_if_fail (folder != NULL);
#line 199 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_if_fail (filename != NULL);
#line 199 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_if_fail (G_IS_FILE (dest_file));
#line 200 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp0_ = dest_file;
#line 200 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp1_ = g_file_get_path (_tmp0_);
#line 200 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp2_ = _tmp1_;
#line 200 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp3_ = creat (_tmp2_, (mode_t) 0640);
#line 200 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp4_ = _tmp3_;
#line 200 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_g_free0 (_tmp2_);
#line 200 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	fd = _tmp4_;
#line 201 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp5_ = fd;
#line 201 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	if (_tmp5_ < 0) {
#line 1964 "GPhoto.c"
		gint _tmp6_ = 0;
		GFile* _tmp7_ = NULL;
		gchar* _tmp8_ = NULL;
		gchar* _tmp9_ = NULL;
		GError* _tmp10_ = NULL;
		GError* _tmp11_ = NULL;
#line 202 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp6_ = errno;
#line 202 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp7_ = dest_file;
#line 202 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp8_ = g_file_get_path (_tmp7_);
#line 202 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp9_ = _tmp8_;
#line 202 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp10_ = g_error_new (G_IO_ERROR, G_IO_ERROR_FAILED, "[%d] Error creating file %s: %m", _tmp6_, _tmp9_);
#line 202 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp11_ = _tmp10_;
#line 202 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_g_free0 (_tmp9_);
#line 202 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_inner_error_ = _tmp11_;
#line 202 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		g_propagate_error (error, _inner_error_);
#line 202 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		return;
#line 1991 "GPhoto.c"
	}
#line 206 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp12_ = fd;
#line 206 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp14_ = gp_file_new_from_fd (&_tmp13_, _tmp12_);
#line 206 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_gp_file_unref0 (camera_file);
#line 206 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	camera_file = _tmp13_;
#line 206 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	res = _tmp14_;
#line 207 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp15_ = res;
#line 207 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	if (_tmp15_ != GP_OK) {
#line 2007 "GPhoto.c"
		int _tmp16_ = 0;
		int _tmp17_ = 0;
		const gchar* _tmp18_ = NULL;
		GError* _tmp19_ = NULL;
#line 208 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp16_ = res;
#line 208 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp17_ = res;
#line 208 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp18_ = gp_port_result_as_string (_tmp17_);
#line 208 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp19_ = g_error_new (GPHOTO_ERROR, GPHOTO_ERROR_LIBRARY, "[%d] Error allocating camera file: %s", (gint) _tmp16_, _tmp18_);
#line 208 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_inner_error_ = _tmp19_;
#line 208 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		g_propagate_error (error, _inner_error_);
#line 208 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_gp_file_unref0 (camera_file);
#line 208 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		return;
#line 2028 "GPhoto.c"
	}
#line 211 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp20_ = camera;
#line 211 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp21_ = folder;
#line 211 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp22_ = filename;
#line 211 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp23_ = camera_file;
#line 211 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp24_ = context;
#line 211 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp25_ = gp_camera_file_get (_tmp20_, _tmp21_, _tmp22_, GP_FILE_TYPE_NORMAL, _tmp23_, _tmp24_);
#line 211 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	res = _tmp25_;
#line 212 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp26_ = res;
#line 212 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	if (_tmp26_ != GP_OK) {
#line 2048 "GPhoto.c"
		int _tmp27_ = 0;
		const gchar* _tmp28_ = NULL;
		const gchar* _tmp29_ = NULL;
		int _tmp30_ = 0;
		const gchar* _tmp31_ = NULL;
		GError* _tmp32_ = NULL;
#line 213 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp27_ = res;
#line 213 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp28_ = folder;
#line 213 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp29_ = filename;
#line 213 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp30_ = res;
#line 213 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp31_ = gp_port_result_as_string (_tmp30_);
#line 213 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp32_ = g_error_new (GPHOTO_ERROR, GPHOTO_ERROR_LIBRARY, "[%d] Error retrieving file object for %s/%s: %s", (gint) _tmp27_, _tmp28_, _tmp29_, _tmp31_);
#line 213 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_inner_error_ = _tmp32_;
#line 213 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		g_propagate_error (error, _inner_error_);
#line 213 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_gp_file_unref0 (camera_file);
#line 213 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		return;
#line 2075 "GPhoto.c"
	}
#line 199 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_gp_file_unref0 (camera_file);
#line 2079 "GPhoto.c"
}


PhotoMetadata* gp_load_metadata (GPContext* context, Camera* camera, const gchar* folder, const gchar* filename, GError** error) {
	PhotoMetadata* result = NULL;
	guint8* camera_raw = NULL;
	gint camera_raw_length1 = 0;
	gint _camera_raw_size_ = 0;
	gboolean _tmp13_ = FALSE;
	guint8* _tmp14_ = NULL;
	gint _tmp14__length1 = 0;
	PhotoMetadata* metadata = NULL;
	PhotoMetadata* _tmp16_ = NULL;
	PhotoMetadata* _tmp17_ = NULL;
	guint8* _tmp18_ = NULL;
	gint _tmp18__length1 = 0;
	GError * _inner_error_ = NULL;
#line 218 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_val_if_fail (context != NULL, NULL);
#line 218 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_val_if_fail (camera != NULL, NULL);
#line 218 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_val_if_fail (folder != NULL, NULL);
#line 218 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_val_if_fail (filename != NULL, NULL);
#line 220 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	camera_raw = NULL;
#line 220 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	camera_raw_length1 = 0;
#line 220 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_camera_raw_size_ = camera_raw_length1;
#line 2111 "GPhoto.c"
	{
		guint8* _tmp0_ = NULL;
		GPContext* _tmp1_ = NULL;
		Camera* _tmp2_ = NULL;
		const gchar* _tmp3_ = NULL;
		const gchar* _tmp4_ = NULL;
		gint _tmp5_ = 0;
		guint8* _tmp6_ = NULL;
		gint _tmp0__length1 = 0;
		gint __tmp0__size_ = 0;
		guint8* _tmp7_ = NULL;
		gint _tmp7__length1 = 0;
#line 222 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp1_ = context;
#line 222 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp2_ = camera;
#line 222 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp3_ = folder;
#line 222 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp4_ = filename;
#line 222 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp6_ = gp_load_file_into_buffer (_tmp1_, _tmp2_, _tmp3_, _tmp4_, GP_FILE_TYPE_EXIF, &_tmp5_, &_inner_error_);
#line 222 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp0_ = _tmp6_;
#line 222 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp0__length1 = _tmp5_;
#line 222 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		__tmp0__size_ = _tmp0__length1;
#line 222 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 2142 "GPhoto.c"
			goto __catch63_g_error;
		}
#line 222 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp7_ = _tmp0_;
#line 222 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp7__length1 = _tmp0__length1;
#line 222 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp0_ = NULL;
#line 222 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp0__length1 = 0;
#line 222 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		camera_raw = (g_free (camera_raw), NULL);
#line 222 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		camera_raw = _tmp7_;
#line 222 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		camera_raw_length1 = _tmp7__length1;
#line 222 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_camera_raw_size_ = camera_raw_length1;
#line 221 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp0_ = (g_free (_tmp0_), NULL);
#line 2163 "GPhoto.c"
	}
	goto __finally63;
	__catch63_g_error:
	{
		Camera* _tmp8_ = NULL;
		GPContext* _tmp9_ = NULL;
		const gchar* _tmp10_ = NULL;
		const gchar* _tmp11_ = NULL;
		PhotoMetadata* _tmp12_ = NULL;
#line 221 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		g_clear_error (&_inner_error_);
#line 221 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_inner_error_ = NULL;
#line 224 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp8_ = camera;
#line 224 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp9_ = context;
#line 224 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp10_ = folder;
#line 224 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp11_ = filename;
#line 224 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp12_ = gp_get_fallback_metadata (_tmp8_, _tmp9_, _tmp10_, _tmp11_);
#line 224 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		result = _tmp12_;
#line 224 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		camera_raw = (g_free (camera_raw), NULL);
#line 224 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		return result;
#line 2193 "GPhoto.c"
	}
	__finally63:
#line 221 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 221 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		g_propagate_error (error, _inner_error_);
#line 221 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		camera_raw = (g_free (camera_raw), NULL);
#line 221 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		return NULL;
#line 2204 "GPhoto.c"
	}
#line 227 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp14_ = camera_raw;
#line 227 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp14__length1 = camera_raw_length1;
#line 227 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	if (_tmp14_ == NULL) {
#line 227 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp13_ = TRUE;
#line 2214 "GPhoto.c"
	} else {
		guint8* _tmp15_ = NULL;
		gint _tmp15__length1 = 0;
#line 227 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp15_ = camera_raw;
#line 227 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp15__length1 = camera_raw_length1;
#line 227 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp13_ = _tmp15__length1 == 0;
#line 2224 "GPhoto.c"
	}
#line 227 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	if (_tmp13_) {
#line 228 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		result = NULL;
#line 228 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		camera_raw = (g_free (camera_raw), NULL);
#line 228 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		return result;
#line 2234 "GPhoto.c"
	}
#line 230 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp16_ = photo_metadata_new ();
#line 230 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	metadata = _tmp16_;
#line 231 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp17_ = metadata;
#line 231 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp18_ = camera_raw;
#line 231 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp18__length1 = camera_raw_length1;
#line 231 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	photo_metadata_read_from_app1_segment (_tmp17_, _tmp18_, _tmp18__length1, 0, &_inner_error_);
#line 231 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 231 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		g_propagate_error (error, _inner_error_);
#line 231 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_media_metadata_unref0 (metadata);
#line 231 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		camera_raw = (g_free (camera_raw), NULL);
#line 231 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		return NULL;
#line 2258 "GPhoto.c"
	}
#line 233 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	result = metadata;
#line 233 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	camera_raw = (g_free (camera_raw), NULL);
#line 233 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	return result;
#line 2266 "GPhoto.c"
}


static guint8* _vala_array_dup24 (guint8* self, int length) {
#line 260 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	return g_memdup (self, length * sizeof (guint8));
#line 2273 "GPhoto.c"
}


static void _gp_on_mins_destroyed_gdestroy_notify (void* data) {
#line 260 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	gp_on_mins_destroyed (data);
#line 2280 "GPhoto.c"
}


GInputStream* gp_load_file_into_stream (GPContext* context, Camera* camera, const gchar* folder, const gchar* filename, CameraFileType filetype, GError** error) {
	GInputStream* result = NULL;
	CameraFile* camera_file = NULL;
	int res = 0;
	CameraFile* _tmp0_ = NULL;
	int _tmp1_ = 0;
	int _tmp2_ = 0;
	Camera* _tmp7_ = NULL;
	const gchar* _tmp8_ = NULL;
	const gchar* _tmp9_ = NULL;
	CameraFileType _tmp10_ = 0;
	GPContext* _tmp11_ = NULL;
	int _tmp12_ = 0;
	int _tmp13_ = 0;
	guint8* data = NULL;
	gulong data_len = 0UL;
	guint8* _tmp20_ = NULL;
	gulong _tmp21_ = 0UL;
	int _tmp22_ = 0;
	int _tmp23_ = 0;
	GFile* temp = NULL;
	GFile* _tmp32_ = NULL;
	GFile* _tmp33_ = NULL;
	GFile* _tmp34_ = NULL;
	GFile* _tmp35_ = NULL;
	GFile* _tmp36_ = NULL;
	gchar* _tmp37_ = NULL;
	gchar* _tmp38_ = NULL;
	int _tmp39_ = 0;
	int _tmp40_ = 0;
	GFileInputStream* _tmp51_ = NULL;
	GFile* _tmp52_ = NULL;
	GFileInputStream* _tmp53_ = NULL;
	GFileInputStream* _tmp54_ = NULL;
	GError * _inner_error_ = NULL;
#line 238 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_val_if_fail (context != NULL, NULL);
#line 238 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_val_if_fail (camera != NULL, NULL);
#line 238 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_val_if_fail (folder != NULL, NULL);
#line 238 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_val_if_fail (filename != NULL, NULL);
#line 241 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp1_ = gp_file_new (&_tmp0_);
#line 241 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_gp_file_unref0 (camera_file);
#line 241 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	camera_file = _tmp0_;
#line 241 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	res = _tmp1_;
#line 242 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp2_ = res;
#line 242 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	if (_tmp2_ != GP_OK) {
#line 2339 "GPhoto.c"
		int _tmp3_ = 0;
		int _tmp4_ = 0;
		const gchar* _tmp5_ = NULL;
		GError* _tmp6_ = NULL;
#line 243 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp3_ = res;
#line 243 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp4_ = res;
#line 243 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp5_ = gp_port_result_as_string (_tmp4_);
#line 243 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp6_ = g_error_new (GPHOTO_ERROR, GPHOTO_ERROR_LIBRARY, "[%d] Error allocating camera file: %s", (gint) _tmp3_, _tmp5_);
#line 243 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_inner_error_ = _tmp6_;
#line 243 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		g_propagate_error (error, _inner_error_);
#line 243 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_gp_file_unref0 (camera_file);
#line 243 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		return NULL;
#line 2360 "GPhoto.c"
	}
#line 245 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp7_ = camera;
#line 245 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp8_ = folder;
#line 245 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp9_ = filename;
#line 245 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp10_ = filetype;
#line 245 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp11_ = context;
#line 245 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp12_ = gp_camera_file_get (_tmp7_, _tmp8_, _tmp9_, _tmp10_, camera_file, _tmp11_);
#line 245 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	res = _tmp12_;
#line 246 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp13_ = res;
#line 246 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	if (_tmp13_ != GP_OK) {
#line 2380 "GPhoto.c"
		int _tmp14_ = 0;
		const gchar* _tmp15_ = NULL;
		const gchar* _tmp16_ = NULL;
		int _tmp17_ = 0;
		const gchar* _tmp18_ = NULL;
		GError* _tmp19_ = NULL;
#line 247 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp14_ = res;
#line 247 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp15_ = folder;
#line 247 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp16_ = filename;
#line 247 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp17_ = res;
#line 247 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp18_ = gp_port_result_as_string (_tmp17_);
#line 247 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp19_ = g_error_new (GPHOTO_ERROR, GPHOTO_ERROR_LIBRARY, "[%d] Error retrieving file object for %s/%s: %s", (gint) _tmp14_, _tmp15_, _tmp16_, _tmp18_);
#line 247 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_inner_error_ = _tmp19_;
#line 247 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		g_propagate_error (error, _inner_error_);
#line 247 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_gp_file_unref0 (camera_file);
#line 247 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		return NULL;
#line 2407 "GPhoto.c"
	}
#line 255 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp22_ = gp_file_get_data_and_size (camera_file, &_tmp20_, &_tmp21_);
#line 255 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	data = _tmp20_;
#line 255 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	data_len = _tmp21_;
#line 255 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	res = _tmp22_;
#line 256 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp23_ = res;
#line 256 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	if (_tmp23_ == GP_OK) {
#line 2421 "GPhoto.c"
		guint8* buffer = NULL;
		gulong _tmp24_ = 0UL;
		guint8* _tmp25_ = NULL;
		gint buffer_length1 = 0;
		gint _buffer_size_ = 0;
		guint8* _tmp26_ = NULL;
		gint _tmp26__length1 = 0;
		guint8* _tmp27_ = NULL;
		guint8* _tmp28_ = NULL;
		gint _tmp28__length1 = 0;
		guint8* _tmp29_ = NULL;
		gint _tmp29__length1 = 0;
		guint8* _tmp30_ = NULL;
		gint _tmp30__length1 = 0;
		GMemoryInputStream* _tmp31_ = NULL;
#line 257 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp24_ = data_len;
#line 257 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp25_ = g_new0 (guint8, _tmp24_);
#line 257 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		buffer = _tmp25_;
#line 257 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		buffer_length1 = _tmp24_;
#line 257 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_buffer_size_ = buffer_length1;
#line 258 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp26_ = buffer;
#line 258 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp26__length1 = buffer_length1;
#line 258 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp27_ = data;
#line 258 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp28_ = buffer;
#line 258 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp28__length1 = buffer_length1;
#line 258 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		memcpy (_tmp26_, _tmp27_, (gsize) _tmp28__length1);
#line 260 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp29_ = buffer;
#line 260 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp29__length1 = buffer_length1;
#line 260 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp30_ = (_tmp29_ != NULL) ? _vala_array_dup24 (_tmp29_, _tmp29__length1) : ((gpointer) _tmp29_);
#line 260 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp30__length1 = _tmp29__length1;
#line 260 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp31_ = (GMemoryInputStream*) g_memory_input_stream_new_from_data (_tmp30_, _tmp30__length1, _gp_on_mins_destroyed_gdestroy_notify);
#line 260 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		result = G_TYPE_CHECK_INSTANCE_CAST (_tmp31_, g_input_stream_get_type (), GInputStream);
#line 260 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		buffer = (g_free (buffer), NULL);
#line 260 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_gp_file_unref0 (camera_file);
#line 260 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		return result;
#line 2477 "GPhoto.c"
	}
#line 264 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp32_ = app_dirs_get_temp_dir ();
#line 264 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp33_ = _tmp32_;
#line 264 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp34_ = g_file_get_child (_tmp33_, "import.tmp");
#line 264 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp35_ = _tmp34_;
#line 264 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_g_object_unref0 (_tmp33_);
#line 264 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	temp = _tmp35_;
#line 265 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp36_ = temp;
#line 265 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp37_ = g_file_get_path (_tmp36_);
#line 265 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp38_ = _tmp37_;
#line 265 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp39_ = gp_file_save (camera_file, _tmp38_);
#line 265 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	res = _tmp39_;
#line 265 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_g_free0 (_tmp38_);
#line 266 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp40_ = res;
#line 266 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	if (_tmp40_ != GP_OK) {
#line 2507 "GPhoto.c"
		int _tmp41_ = 0;
		const gchar* _tmp42_ = NULL;
		const gchar* _tmp43_ = NULL;
		GFile* _tmp44_ = NULL;
		gchar* _tmp45_ = NULL;
		gchar* _tmp46_ = NULL;
		int _tmp47_ = 0;
		const gchar* _tmp48_ = NULL;
		GError* _tmp49_ = NULL;
		GError* _tmp50_ = NULL;
#line 267 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp41_ = res;
#line 267 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp42_ = folder;
#line 267 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp43_ = filename;
#line 267 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp44_ = temp;
#line 267 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp45_ = g_file_get_path (_tmp44_);
#line 267 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp46_ = _tmp45_;
#line 267 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp47_ = res;
#line 267 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp48_ = gp_port_result_as_string (_tmp47_);
#line 267 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp49_ = g_error_new (GPHOTO_ERROR, GPHOTO_ERROR_LIBRARY, "[%d] Error copying file %s/%s to %s: %s", (gint) _tmp41_, _tmp42_, _tmp43_, _tmp46_, _tmp48_);
#line 267 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp50_ = _tmp49_;
#line 267 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_g_free0 (_tmp46_);
#line 267 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_inner_error_ = _tmp50_;
#line 267 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		g_propagate_error (error, _inner_error_);
#line 267 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_g_object_unref0 (temp);
#line 267 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_gp_file_unref0 (camera_file);
#line 267 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		return NULL;
#line 2550 "GPhoto.c"
	}
#line 270 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp52_ = temp;
#line 270 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp53_ = g_file_read (_tmp52_, NULL, &_inner_error_);
#line 270 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp51_ = _tmp53_;
#line 270 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 270 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		g_propagate_error (error, _inner_error_);
#line 270 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_g_object_unref0 (temp);
#line 270 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_gp_file_unref0 (camera_file);
#line 270 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		return NULL;
#line 2568 "GPhoto.c"
	}
#line 270 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp54_ = _tmp51_;
#line 270 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp51_ = NULL;
#line 270 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	result = G_TYPE_CHECK_INSTANCE_CAST (_tmp54_, g_input_stream_get_type (), GInputStream);
#line 270 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_g_object_unref0 (_tmp51_);
#line 270 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_g_object_unref0 (temp);
#line 270 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_gp_file_unref0 (camera_file);
#line 270 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	return result;
#line 2584 "GPhoto.c"
}


void gp_on_mins_destroyed (void* data) {
	void* _tmp0_ = NULL;
#line 274 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp0_ = data;
#line 274 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_free (_tmp0_);
#line 2594 "GPhoto.c"
}


guint8* gp_load_file_into_buffer (GPContext* context, Camera* camera, const gchar* folder, const gchar* filename, CameraFileType filetype, int* result_length1, GError** error) {
	guint8* result = NULL;
	CameraFile* camera_file = NULL;
	int res = 0;
	CameraFile* _tmp0_ = NULL;
	int _tmp1_ = 0;
	int _tmp2_ = 0;
	Camera* _tmp7_ = NULL;
	const gchar* _tmp8_ = NULL;
	const gchar* _tmp9_ = NULL;
	CameraFileType _tmp10_ = 0;
	CameraFile* _tmp11_ = NULL;
	GPContext* _tmp12_ = NULL;
	int _tmp13_ = 0;
	int _tmp14_ = 0;
	guint8* data = NULL;
	gulong data_len = 0UL;
	CameraFile* _tmp21_ = NULL;
	guint8* _tmp22_ = NULL;
	gulong _tmp23_ = 0UL;
	int _tmp24_ = 0;
	int _tmp25_ = 0;
	guint8* buffer = NULL;
	gulong _tmp27_ = 0UL;
	guint8* _tmp28_ = NULL;
	gint buffer_length1 = 0;
	gint _buffer_size_ = 0;
	guint8* _tmp29_ = NULL;
	gint _tmp29__length1 = 0;
	guint8* _tmp30_ = NULL;
	guint8* _tmp31_ = NULL;
	gint _tmp31__length1 = 0;
	guint8* _tmp32_ = NULL;
	gint _tmp32__length1 = 0;
	GError * _inner_error_ = NULL;
#line 278 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_val_if_fail (context != NULL, NULL);
#line 278 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_val_if_fail (camera != NULL, NULL);
#line 278 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_val_if_fail (folder != NULL, NULL);
#line 278 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	g_return_val_if_fail (filename != NULL, NULL);
#line 281 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp1_ = gp_file_new (&_tmp0_);
#line 281 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_gp_file_unref0 (camera_file);
#line 281 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	camera_file = _tmp0_;
#line 281 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	res = _tmp1_;
#line 282 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp2_ = res;
#line 282 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	if (_tmp2_ != GP_OK) {
#line 2653 "GPhoto.c"
		int _tmp3_ = 0;
		int _tmp4_ = 0;
		const gchar* _tmp5_ = NULL;
		GError* _tmp6_ = NULL;
#line 283 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp3_ = res;
#line 283 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp4_ = res;
#line 283 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp5_ = gp_port_result_as_string (_tmp4_);
#line 283 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp6_ = g_error_new (GPHOTO_ERROR, GPHOTO_ERROR_LIBRARY, "[%d] Error allocating camera file: %s", (gint) _tmp3_, _tmp5_);
#line 283 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_inner_error_ = _tmp6_;
#line 283 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		g_propagate_error (error, _inner_error_);
#line 283 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_gp_file_unref0 (camera_file);
#line 283 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		return NULL;
#line 2674 "GPhoto.c"
	}
#line 285 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp7_ = camera;
#line 285 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp8_ = folder;
#line 285 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp9_ = filename;
#line 285 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp10_ = filetype;
#line 285 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp11_ = camera_file;
#line 285 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp12_ = context;
#line 285 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp13_ = gp_camera_file_get (_tmp7_, _tmp8_, _tmp9_, _tmp10_, _tmp11_, _tmp12_);
#line 285 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	res = _tmp13_;
#line 286 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp14_ = res;
#line 286 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	if (_tmp14_ != GP_OK) {
#line 2696 "GPhoto.c"
		int _tmp15_ = 0;
		const gchar* _tmp16_ = NULL;
		const gchar* _tmp17_ = NULL;
		int _tmp18_ = 0;
		const gchar* _tmp19_ = NULL;
		GError* _tmp20_ = NULL;
#line 287 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp15_ = res;
#line 287 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp16_ = folder;
#line 287 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp17_ = filename;
#line 287 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp18_ = res;
#line 287 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp19_ = gp_port_result_as_string (_tmp18_);
#line 287 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp20_ = g_error_new (GPHOTO_ERROR, GPHOTO_ERROR_LIBRARY, "[%d] Error retrieving file object for %s/%s: %s", (gint) _tmp15_, _tmp16_, _tmp17_, _tmp19_);
#line 287 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_inner_error_ = _tmp20_;
#line 287 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		g_propagate_error (error, _inner_error_);
#line 287 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_gp_file_unref0 (camera_file);
#line 287 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		return NULL;
#line 2723 "GPhoto.c"
	}
#line 294 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp21_ = camera_file;
#line 294 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp24_ = gp_file_get_data_and_size (_tmp21_, &_tmp22_, &_tmp23_);
#line 294 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	data = _tmp22_;
#line 294 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	data_len = _tmp23_;
#line 294 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	res = _tmp24_;
#line 295 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp25_ = res;
#line 295 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	if (_tmp25_ != GP_OK) {
#line 2739 "GPhoto.c"
		guint8* _tmp26_ = NULL;
		gint _tmp26__length1 = 0;
#line 296 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp26_ = NULL;
#line 296 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_tmp26__length1 = 0;
#line 296 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		if (result_length1) {
#line 296 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
			*result_length1 = _tmp26__length1;
#line 2750 "GPhoto.c"
		}
#line 296 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		result = _tmp26_;
#line 296 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		_gp_file_unref0 (camera_file);
#line 296 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		return result;
#line 2758 "GPhoto.c"
	}
#line 298 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp27_ = data_len;
#line 298 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp28_ = g_new0 (guint8, _tmp27_);
#line 298 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	buffer = _tmp28_;
#line 298 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	buffer_length1 = _tmp27_;
#line 298 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_buffer_size_ = buffer_length1;
#line 299 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp29_ = buffer;
#line 299 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp29__length1 = buffer_length1;
#line 299 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp30_ = data;
#line 299 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp31_ = buffer;
#line 299 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp31__length1 = buffer_length1;
#line 299 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	memcpy (_tmp29_, _tmp30_, (gsize) _tmp31__length1);
#line 301 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp32_ = buffer;
#line 301 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_tmp32__length1 = buffer_length1;
#line 301 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	if (result_length1) {
#line 301 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
		*result_length1 = _tmp32__length1;
#line 2790 "GPhoto.c"
	}
#line 301 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	result = _tmp32_;
#line 301 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	_gp_file_unref0 (camera_file);
#line 301 "/home/jens/Source/shotwell/src/camera/GPhoto.vala"
	return result;
#line 2798 "GPhoto.c"
}