summaryrefslogtreecommitdiff
path: root/src/photos/JfifSupport.c
blob: 1891b36ea30c7bad46ac10adaab8960e3f64cb95 (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
/* JfifSupport.c generated by valac 0.34.7, the Vala compiler
 * generated from JfifSupport.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 <gio/gio.h>
#include <glib/gi18n-lib.h>
#include <gdk-pixbuf/gdk-pixbuf.h>


#define TYPE_PHOTO_FILE_FORMAT_DRIVER (photo_file_format_driver_get_type ())
#define PHOTO_FILE_FORMAT_DRIVER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PHOTO_FILE_FORMAT_DRIVER, PhotoFileFormatDriver))
#define PHOTO_FILE_FORMAT_DRIVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PHOTO_FILE_FORMAT_DRIVER, PhotoFileFormatDriverClass))
#define IS_PHOTO_FILE_FORMAT_DRIVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PHOTO_FILE_FORMAT_DRIVER))
#define IS_PHOTO_FILE_FORMAT_DRIVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PHOTO_FILE_FORMAT_DRIVER))
#define PHOTO_FILE_FORMAT_DRIVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PHOTO_FILE_FORMAT_DRIVER, PhotoFileFormatDriverClass))

typedef struct _PhotoFileFormatDriver PhotoFileFormatDriver;
typedef struct _PhotoFileFormatDriverClass PhotoFileFormatDriverClass;
typedef struct _PhotoFileFormatDriverPrivate PhotoFileFormatDriverPrivate;

#define TYPE_PHOTO_FILE_FORMAT_PROPERTIES (photo_file_format_properties_get_type ())
#define PHOTO_FILE_FORMAT_PROPERTIES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PHOTO_FILE_FORMAT_PROPERTIES, PhotoFileFormatProperties))
#define PHOTO_FILE_FORMAT_PROPERTIES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PHOTO_FILE_FORMAT_PROPERTIES, PhotoFileFormatPropertiesClass))
#define IS_PHOTO_FILE_FORMAT_PROPERTIES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PHOTO_FILE_FORMAT_PROPERTIES))
#define IS_PHOTO_FILE_FORMAT_PROPERTIES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PHOTO_FILE_FORMAT_PROPERTIES))
#define PHOTO_FILE_FORMAT_PROPERTIES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PHOTO_FILE_FORMAT_PROPERTIES, PhotoFileFormatPropertiesClass))

typedef struct _PhotoFileFormatProperties PhotoFileFormatProperties;
typedef struct _PhotoFileFormatPropertiesClass PhotoFileFormatPropertiesClass;

#define TYPE_PHOTO_FILE_ADAPTER (photo_file_adapter_get_type ())
#define PHOTO_FILE_ADAPTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter))
#define PHOTO_FILE_ADAPTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapterClass))
#define IS_PHOTO_FILE_ADAPTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PHOTO_FILE_ADAPTER))
#define IS_PHOTO_FILE_ADAPTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PHOTO_FILE_ADAPTER))
#define PHOTO_FILE_ADAPTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapterClass))

typedef struct _PhotoFileAdapter PhotoFileAdapter;
typedef struct _PhotoFileAdapterClass PhotoFileAdapterClass;

#define TYPE_PHOTO_FILE_READER (photo_file_reader_get_type ())
#define PHOTO_FILE_READER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PHOTO_FILE_READER, PhotoFileReader))
#define PHOTO_FILE_READER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PHOTO_FILE_READER, PhotoFileReaderClass))
#define IS_PHOTO_FILE_READER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PHOTO_FILE_READER))
#define IS_PHOTO_FILE_READER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PHOTO_FILE_READER))
#define PHOTO_FILE_READER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PHOTO_FILE_READER, PhotoFileReaderClass))

typedef struct _PhotoFileReader PhotoFileReader;
typedef struct _PhotoFileReaderClass PhotoFileReaderClass;

#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 TYPE_PHOTO_FILE_WRITER (photo_file_writer_get_type ())
#define PHOTO_FILE_WRITER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PHOTO_FILE_WRITER, PhotoFileWriter))
#define PHOTO_FILE_WRITER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PHOTO_FILE_WRITER, PhotoFileWriterClass))
#define IS_PHOTO_FILE_WRITER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PHOTO_FILE_WRITER))
#define IS_PHOTO_FILE_WRITER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PHOTO_FILE_WRITER))
#define PHOTO_FILE_WRITER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PHOTO_FILE_WRITER, PhotoFileWriterClass))

typedef struct _PhotoFileWriter PhotoFileWriter;
typedef struct _PhotoFileWriterClass PhotoFileWriterClass;

#define TYPE_PHOTO_FILE_METADATA_WRITER (photo_file_metadata_writer_get_type ())
#define PHOTO_FILE_METADATA_WRITER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PHOTO_FILE_METADATA_WRITER, PhotoFileMetadataWriter))
#define PHOTO_FILE_METADATA_WRITER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PHOTO_FILE_METADATA_WRITER, PhotoFileMetadataWriterClass))
#define IS_PHOTO_FILE_METADATA_WRITER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PHOTO_FILE_METADATA_WRITER))
#define IS_PHOTO_FILE_METADATA_WRITER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PHOTO_FILE_METADATA_WRITER))
#define PHOTO_FILE_METADATA_WRITER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PHOTO_FILE_METADATA_WRITER, PhotoFileMetadataWriterClass))

typedef struct _PhotoFileMetadataWriter PhotoFileMetadataWriter;
typedef struct _PhotoFileMetadataWriterClass PhotoFileMetadataWriterClass;

#define PHOTO_FILE_SNIFFER_TYPE_OPTIONS (photo_file_sniffer_options_get_type ())

#define TYPE_PHOTO_FILE_SNIFFER (photo_file_sniffer_get_type ())
#define PHOTO_FILE_SNIFFER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PHOTO_FILE_SNIFFER, PhotoFileSniffer))
#define PHOTO_FILE_SNIFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PHOTO_FILE_SNIFFER, PhotoFileSnifferClass))
#define IS_PHOTO_FILE_SNIFFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PHOTO_FILE_SNIFFER))
#define IS_PHOTO_FILE_SNIFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PHOTO_FILE_SNIFFER))
#define PHOTO_FILE_SNIFFER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PHOTO_FILE_SNIFFER, PhotoFileSnifferClass))

typedef struct _PhotoFileSniffer PhotoFileSniffer;
typedef struct _PhotoFileSnifferClass PhotoFileSnifferClass;

#define TYPE_JFIF_FILE_FORMAT_DRIVER (jfif_file_format_driver_get_type ())
#define JFIF_FILE_FORMAT_DRIVER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_JFIF_FILE_FORMAT_DRIVER, JfifFileFormatDriver))
#define JFIF_FILE_FORMAT_DRIVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_JFIF_FILE_FORMAT_DRIVER, JfifFileFormatDriverClass))
#define IS_JFIF_FILE_FORMAT_DRIVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_JFIF_FILE_FORMAT_DRIVER))
#define IS_JFIF_FILE_FORMAT_DRIVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_JFIF_FILE_FORMAT_DRIVER))
#define JFIF_FILE_FORMAT_DRIVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_JFIF_FILE_FORMAT_DRIVER, JfifFileFormatDriverClass))

typedef struct _JfifFileFormatDriver JfifFileFormatDriver;
typedef struct _JfifFileFormatDriverClass JfifFileFormatDriverClass;
typedef struct _JfifFileFormatDriverPrivate JfifFileFormatDriverPrivate;
#define _photo_file_format_driver_unref0(var) ((var == NULL) ? NULL : (var = (photo_file_format_driver_unref (var), NULL)))

#define TYPE_JFIF_FILE_FORMAT_PROPERTIES (jfif_file_format_properties_get_type ())
#define JFIF_FILE_FORMAT_PROPERTIES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_JFIF_FILE_FORMAT_PROPERTIES, JfifFileFormatProperties))
#define JFIF_FILE_FORMAT_PROPERTIES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_JFIF_FILE_FORMAT_PROPERTIES, JfifFileFormatPropertiesClass))
#define IS_JFIF_FILE_FORMAT_PROPERTIES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_JFIF_FILE_FORMAT_PROPERTIES))
#define IS_JFIF_FILE_FORMAT_PROPERTIES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_JFIF_FILE_FORMAT_PROPERTIES))
#define JFIF_FILE_FORMAT_PROPERTIES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_JFIF_FILE_FORMAT_PROPERTIES, JfifFileFormatPropertiesClass))

typedef struct _JfifFileFormatProperties JfifFileFormatProperties;
typedef struct _JfifFileFormatPropertiesClass JfifFileFormatPropertiesClass;

#define TYPE_GDK_READER (gdk_reader_get_type ())
#define GDK_READER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_GDK_READER, GdkReader))
#define GDK_READER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_GDK_READER, GdkReaderClass))
#define IS_GDK_READER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_GDK_READER))
#define IS_GDK_READER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_GDK_READER))
#define GDK_READER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_GDK_READER, GdkReaderClass))

typedef struct _GdkReader GdkReader;
typedef struct _GdkReaderClass GdkReaderClass;

#define TYPE_JFIF_READER (jfif_reader_get_type ())
#define JFIF_READER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_JFIF_READER, JfifReader))
#define JFIF_READER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_JFIF_READER, JfifReaderClass))
#define IS_JFIF_READER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_JFIF_READER))
#define IS_JFIF_READER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_JFIF_READER))
#define JFIF_READER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_JFIF_READER, JfifReaderClass))

typedef struct _JfifReader JfifReader;
typedef struct _JfifReaderClass JfifReaderClass;

#define TYPE_JFIF_WRITER (jfif_writer_get_type ())
#define JFIF_WRITER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_JFIF_WRITER, JfifWriter))
#define JFIF_WRITER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_JFIF_WRITER, JfifWriterClass))
#define IS_JFIF_WRITER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_JFIF_WRITER))
#define IS_JFIF_WRITER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_JFIF_WRITER))
#define JFIF_WRITER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_JFIF_WRITER, JfifWriterClass))

typedef struct _JfifWriter JfifWriter;
typedef struct _JfifWriterClass JfifWriterClass;

#define TYPE_JFIF_METADATA_WRITER (jfif_metadata_writer_get_type ())
#define JFIF_METADATA_WRITER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_JFIF_METADATA_WRITER, JfifMetadataWriter))
#define JFIF_METADATA_WRITER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_JFIF_METADATA_WRITER, JfifMetadataWriterClass))
#define IS_JFIF_METADATA_WRITER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_JFIF_METADATA_WRITER))
#define IS_JFIF_METADATA_WRITER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_JFIF_METADATA_WRITER))
#define JFIF_METADATA_WRITER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_JFIF_METADATA_WRITER, JfifMetadataWriterClass))

typedef struct _JfifMetadataWriter JfifMetadataWriter;
typedef struct _JfifMetadataWriterClass JfifMetadataWriterClass;

#define TYPE_GDK_SNIFFER (gdk_sniffer_get_type ())
#define GDK_SNIFFER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_GDK_SNIFFER, GdkSniffer))
#define GDK_SNIFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_GDK_SNIFFER, GdkSnifferClass))
#define IS_GDK_SNIFFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_GDK_SNIFFER))
#define IS_GDK_SNIFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_GDK_SNIFFER))
#define GDK_SNIFFER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_GDK_SNIFFER, GdkSnifferClass))

typedef struct _GdkSniffer GdkSniffer;
typedef struct _GdkSnifferClass GdkSnifferClass;

#define TYPE_JFIF_SNIFFER (jfif_sniffer_get_type ())
#define JFIF_SNIFFER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_JFIF_SNIFFER, JfifSniffer))
#define JFIF_SNIFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_JFIF_SNIFFER, JfifSnifferClass))
#define IS_JFIF_SNIFFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_JFIF_SNIFFER))
#define IS_JFIF_SNIFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_JFIF_SNIFFER))
#define JFIF_SNIFFER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_JFIF_SNIFFER, JfifSnifferClass))

typedef struct _JfifSniffer JfifSniffer;
typedef struct _JfifSnifferClass JfifSnifferClass;
typedef struct _PhotoFileFormatPropertiesPrivate PhotoFileFormatPropertiesPrivate;

#define TYPE_PHOTO_FILE_FORMAT (photo_file_format_get_type ())

#define TYPE_PHOTO_FILE_FORMAT_FLAGS (photo_file_format_flags_get_type ())
typedef struct _JfifFileFormatPropertiesPrivate JfifFileFormatPropertiesPrivate;
#define _photo_file_format_properties_unref0(var) ((var == NULL) ? NULL : (var = (photo_file_format_properties_unref (var), NULL)))
typedef struct _PhotoFileSnifferPrivate PhotoFileSnifferPrivate;

#define TYPE_DETECTED_PHOTO_INFORMATION (detected_photo_information_get_type ())
#define DETECTED_PHOTO_INFORMATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DETECTED_PHOTO_INFORMATION, DetectedPhotoInformation))
#define DETECTED_PHOTO_INFORMATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DETECTED_PHOTO_INFORMATION, DetectedPhotoInformationClass))
#define IS_DETECTED_PHOTO_INFORMATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DETECTED_PHOTO_INFORMATION))
#define IS_DETECTED_PHOTO_INFORMATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DETECTED_PHOTO_INFORMATION))
#define DETECTED_PHOTO_INFORMATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DETECTED_PHOTO_INFORMATION, DetectedPhotoInformationClass))

typedef struct _DetectedPhotoInformation DetectedPhotoInformation;
typedef struct _DetectedPhotoInformationClass DetectedPhotoInformationClass;
typedef struct _GdkSnifferPrivate GdkSnifferPrivate;
typedef struct _JfifSnifferPrivate JfifSnifferPrivate;
#define _detected_photo_information_unref0(var) ((var == NULL) ? NULL : (var = (detected_photo_information_unref (var), NULL)))
typedef struct _DetectedPhotoInformationPrivate DetectedPhotoInformationPrivate;

#define TYPE_DIMENSIONS (dimensions_get_type ())
typedef struct _Dimensions Dimensions;
typedef struct _PhotoFileAdapterPrivate PhotoFileAdapterPrivate;
typedef struct _PhotoFileReaderPrivate PhotoFileReaderPrivate;
typedef struct _GdkReaderPrivate GdkReaderPrivate;
typedef struct _JfifReaderPrivate JfifReaderPrivate;
typedef struct _PhotoFileWriterPrivate PhotoFileWriterPrivate;

#define JPEG_TYPE_QUALITY (jpeg_quality_get_type ())
typedef struct _JfifWriterPrivate JfifWriterPrivate;
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _PhotoFileMetadataWriterPrivate PhotoFileMetadataWriterPrivate;
typedef struct _JfifMetadataWriterPrivate JfifMetadataWriterPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define JPEG_TYPE_MARKER (jpeg_marker_get_type ())

typedef enum  {
	PHOTO_FILE_SNIFFER_OPTIONS_GET_ALL = 0x00000000,
	PHOTO_FILE_SNIFFER_OPTIONS_NO_MD5 = 0x00000001
} PhotoFileSnifferOptions;

struct _PhotoFileFormatDriver {
	GTypeInstance parent_instance;
	volatile int ref_count;
	PhotoFileFormatDriverPrivate * priv;
};

struct _PhotoFileFormatDriverClass {
	GTypeClass parent_class;
	void (*finalize) (PhotoFileFormatDriver *self);
	PhotoFileFormatProperties* (*get_properties) (PhotoFileFormatDriver* self);
	PhotoFileReader* (*create_reader) (PhotoFileFormatDriver* self, const gchar* filepath);
	PhotoMetadata* (*create_metadata) (PhotoFileFormatDriver* self);
	gboolean (*can_write_image) (PhotoFileFormatDriver* self);
	gboolean (*can_write_metadata) (PhotoFileFormatDriver* self);
	PhotoFileWriter* (*create_writer) (PhotoFileFormatDriver* self, const gchar* filepath);
	PhotoFileMetadataWriter* (*create_metadata_writer) (PhotoFileFormatDriver* self, const gchar* filepath);
	PhotoFileSniffer* (*create_sniffer) (PhotoFileFormatDriver* self, GFile* file, PhotoFileSnifferOptions options);
};

struct _JfifFileFormatDriver {
	PhotoFileFormatDriver parent_instance;
	JfifFileFormatDriverPrivate * priv;
};

struct _JfifFileFormatDriverClass {
	PhotoFileFormatDriverClass parent_class;
};

typedef enum  {
	PHOTO_FILE_FORMAT_JFIF,
	PHOTO_FILE_FORMAT_RAW,
	PHOTO_FILE_FORMAT_PNG,
	PHOTO_FILE_FORMAT_TIFF,
	PHOTO_FILE_FORMAT_BMP,
	PHOTO_FILE_FORMAT_UNKNOWN
} PhotoFileFormat;

typedef enum  {
	PHOTO_FILE_FORMAT_FLAGS_NONE = 0x00000000
} PhotoFileFormatFlags;

struct _PhotoFileFormatProperties {
	GTypeInstance parent_instance;
	volatile int ref_count;
	PhotoFileFormatPropertiesPrivate * priv;
};

struct _PhotoFileFormatPropertiesClass {
	GTypeClass parent_class;
	void (*finalize) (PhotoFileFormatProperties *self);
	PhotoFileFormat (*get_file_format) (PhotoFileFormatProperties* self);
	PhotoFileFormatFlags (*get_flags) (PhotoFileFormatProperties* self);
	gboolean (*is_recognized_extension) (PhotoFileFormatProperties* self, const gchar* ext);
	gchar* (*get_default_extension) (PhotoFileFormatProperties* self);
	gchar** (*get_known_extensions) (PhotoFileFormatProperties* self, int* result_length1);
	gchar* (*get_default_mime_type) (PhotoFileFormatProperties* self);
	gchar** (*get_mime_types) (PhotoFileFormatProperties* self, int* result_length1);
	gchar* (*get_user_visible_name) (PhotoFileFormatProperties* self);
};

struct _JfifFileFormatProperties {
	PhotoFileFormatProperties parent_instance;
	JfifFileFormatPropertiesPrivate * priv;
};

struct _JfifFileFormatPropertiesClass {
	PhotoFileFormatPropertiesClass parent_class;
};

struct _PhotoFileSniffer {
	GTypeInstance parent_instance;
	volatile int ref_count;
	PhotoFileSnifferPrivate * priv;
	GFile* file;
	PhotoFileSnifferOptions options;
	gboolean calc_md5;
};

struct _PhotoFileSnifferClass {
	GTypeClass parent_class;
	void (*finalize) (PhotoFileSniffer *self);
	DetectedPhotoInformation* (*sniff) (PhotoFileSniffer* self, gboolean* is_corrupted, GError** error);
};

struct _GdkSniffer {
	PhotoFileSniffer parent_instance;
	GdkSnifferPrivate * priv;
};

struct _GdkSnifferClass {
	PhotoFileSnifferClass parent_class;
};

struct _JfifSniffer {
	GdkSniffer parent_instance;
	JfifSnifferPrivate * priv;
};

struct _JfifSnifferClass {
	GdkSnifferClass parent_class;
};

struct _Dimensions {
	gint width;
	gint height;
};

struct _DetectedPhotoInformation {
	GTypeInstance parent_instance;
	volatile int ref_count;
	DetectedPhotoInformationPrivate * priv;
	PhotoFileFormat file_format;
	PhotoMetadata* metadata;
	gchar* md5;
	gchar* exif_md5;
	gchar* thumbnail_md5;
	gchar* format_name;
	Dimensions image_dim;
	GdkColorspace colorspace;
	gint channels;
	gint bits_per_channel;
};

struct _DetectedPhotoInformationClass {
	GTypeClass parent_class;
	void (*finalize) (DetectedPhotoInformation *self);
};

struct _PhotoFileAdapter {
	GTypeInstance parent_instance;
	volatile int ref_count;
	PhotoFileAdapterPrivate * priv;
};

struct _PhotoFileAdapterClass {
	GTypeClass parent_class;
	void (*finalize) (PhotoFileAdapter *self);
};

struct _PhotoFileReader {
	PhotoFileAdapter parent_instance;
	PhotoFileReaderPrivate * priv;
};

struct _PhotoFileReaderClass {
	PhotoFileAdapterClass parent_class;
	PhotoMetadata* (*read_metadata) (PhotoFileReader* self, GError** error);
	GdkPixbuf* (*unscaled_read) (PhotoFileReader* self, GError** error);
	GdkPixbuf* (*scaled_read) (PhotoFileReader* self, Dimensions* full, Dimensions* scaled, GError** error);
};

struct _GdkReader {
	PhotoFileReader parent_instance;
	GdkReaderPrivate * priv;
};

struct _GdkReaderClass {
	PhotoFileReaderClass parent_class;
};

struct _JfifReader {
	GdkReader parent_instance;
	JfifReaderPrivate * priv;
};

struct _JfifReaderClass {
	GdkReaderClass parent_class;
};

typedef enum  {
	JPEG_QUALITY_LOW = 50,
	JPEG_QUALITY_MEDIUM = 75,
	JPEG_QUALITY_HIGH = 90,
	JPEG_QUALITY_MAXIMUM = 100
} JpegQuality;

struct _PhotoFileWriter {
	PhotoFileAdapter parent_instance;
	PhotoFileWriterPrivate * priv;
};

struct _PhotoFileWriterClass {
	PhotoFileAdapterClass parent_class;
	void (*write) (PhotoFileWriter* self, GdkPixbuf* pixbuf, JpegQuality quality, GError** error);
};

struct _JfifWriter {
	PhotoFileWriter parent_instance;
	JfifWriterPrivate * priv;
};

struct _JfifWriterClass {
	PhotoFileWriterClass parent_class;
};

struct _PhotoFileMetadataWriter {
	PhotoFileAdapter parent_instance;
	PhotoFileMetadataWriterPrivate * priv;
};

struct _PhotoFileMetadataWriterClass {
	PhotoFileAdapterClass parent_class;
	void (*write_metadata) (PhotoFileMetadataWriter* self, PhotoMetadata* metadata, GError** error);
};

struct _JfifMetadataWriter {
	PhotoFileMetadataWriter parent_instance;
	JfifMetadataWriterPrivate * priv;
};

struct _JfifMetadataWriterClass {
	PhotoFileMetadataWriterClass 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 jfif_file_format_driver_parent_class = NULL;
static JfifFileFormatDriver* jfif_file_format_driver_instance;
static JfifFileFormatDriver* jfif_file_format_driver_instance = NULL;
static gpointer jfif_file_format_properties_parent_class = NULL;
static gchar** jfif_file_format_properties_KNOWN_EXTENSIONS;
static gint jfif_file_format_properties_KNOWN_EXTENSIONS_length1;
static gchar** jfif_file_format_properties_KNOWN_EXTENSIONS = NULL;
static gint jfif_file_format_properties_KNOWN_EXTENSIONS_length1 = 0;
static gint _jfif_file_format_properties_KNOWN_EXTENSIONS_size_ = 0;
static gchar** jfif_file_format_properties_KNOWN_MIME_TYPES;
static gint jfif_file_format_properties_KNOWN_MIME_TYPES_length1;
static gchar** jfif_file_format_properties_KNOWN_MIME_TYPES = NULL;
static gint jfif_file_format_properties_KNOWN_MIME_TYPES_length1 = 0;
static gint _jfif_file_format_properties_KNOWN_MIME_TYPES_size_ = 0;
static JfifFileFormatProperties* jfif_file_format_properties_instance;
static JfifFileFormatProperties* jfif_file_format_properties_instance = NULL;
static gpointer jfif_sniffer_parent_class = NULL;
static gpointer jfif_reader_parent_class = NULL;
static gpointer jfif_writer_parent_class = NULL;
static gpointer jfif_metadata_writer_parent_class = NULL;

gpointer photo_file_format_driver_ref (gpointer instance);
void photo_file_format_driver_unref (gpointer instance);
GParamSpec* param_spec_photo_file_format_driver (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_photo_file_format_driver (GValue* value, gpointer v_object);
void value_take_photo_file_format_driver (GValue* value, gpointer v_object);
gpointer value_get_photo_file_format_driver (const GValue* value);
GType photo_file_format_driver_get_type (void) G_GNUC_CONST;
gpointer photo_file_format_properties_ref (gpointer instance);
void photo_file_format_properties_unref (gpointer instance);
GParamSpec* param_spec_photo_file_format_properties (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_photo_file_format_properties (GValue* value, gpointer v_object);
void value_take_photo_file_format_properties (GValue* value, gpointer v_object);
gpointer value_get_photo_file_format_properties (const GValue* value);
GType photo_file_format_properties_get_type (void) G_GNUC_CONST;
gpointer photo_file_adapter_ref (gpointer instance);
void photo_file_adapter_unref (gpointer instance);
GParamSpec* param_spec_photo_file_adapter (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_photo_file_adapter (GValue* value, gpointer v_object);
void value_take_photo_file_adapter (GValue* value, gpointer v_object);
gpointer value_get_photo_file_adapter (const GValue* value);
GType photo_file_adapter_get_type (void) G_GNUC_CONST;
GType photo_file_reader_get_type (void) G_GNUC_CONST;
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;
GType photo_file_writer_get_type (void) G_GNUC_CONST;
GType photo_file_metadata_writer_get_type (void) G_GNUC_CONST;
GType photo_file_sniffer_options_get_type (void) G_GNUC_CONST;
gpointer photo_file_sniffer_ref (gpointer instance);
void photo_file_sniffer_unref (gpointer instance);
GParamSpec* param_spec_photo_file_sniffer (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_photo_file_sniffer (GValue* value, gpointer v_object);
void value_take_photo_file_sniffer (GValue* value, gpointer v_object);
gpointer value_get_photo_file_sniffer (const GValue* value);
GType photo_file_sniffer_get_type (void) G_GNUC_CONST;
GType jfif_file_format_driver_get_type (void) G_GNUC_CONST;
enum  {
	JFIF_FILE_FORMAT_DRIVER_DUMMY_PROPERTY
};
void jfif_file_format_driver_init (void);
JfifFileFormatDriver* jfif_file_format_driver_new (void);
JfifFileFormatDriver* jfif_file_format_driver_construct (GType object_type);
void jfif_file_format_properties_init (void);
JfifFileFormatDriver* jfif_file_format_driver_get_instance (void);
static PhotoFileFormatProperties* jfif_file_format_driver_real_get_properties (PhotoFileFormatDriver* base);
GType jfif_file_format_properties_get_type (void) G_GNUC_CONST;
JfifFileFormatProperties* jfif_file_format_properties_get_instance (void);
static PhotoFileReader* jfif_file_format_driver_real_create_reader (PhotoFileFormatDriver* base, const gchar* filepath);
JfifReader* jfif_reader_new (const gchar* filepath);
JfifReader* jfif_reader_construct (GType object_type, const gchar* filepath);
GType gdk_reader_get_type (void) G_GNUC_CONST;
GType jfif_reader_get_type (void) G_GNUC_CONST;
static PhotoMetadata* jfif_file_format_driver_real_create_metadata (PhotoFileFormatDriver* base);
PhotoMetadata* photo_metadata_new (void);
PhotoMetadata* photo_metadata_construct (GType object_type);
static gboolean jfif_file_format_driver_real_can_write_image (PhotoFileFormatDriver* base);
static gboolean jfif_file_format_driver_real_can_write_metadata (PhotoFileFormatDriver* base);
static PhotoFileWriter* jfif_file_format_driver_real_create_writer (PhotoFileFormatDriver* base, const gchar* filepath);
JfifWriter* jfif_writer_new (const gchar* filepath);
JfifWriter* jfif_writer_construct (GType object_type, const gchar* filepath);
GType jfif_writer_get_type (void) G_GNUC_CONST;
static PhotoFileMetadataWriter* jfif_file_format_driver_real_create_metadata_writer (PhotoFileFormatDriver* base, const gchar* filepath);
JfifMetadataWriter* jfif_metadata_writer_new (const gchar* filepath);
JfifMetadataWriter* jfif_metadata_writer_construct (GType object_type, const gchar* filepath);
GType jfif_metadata_writer_get_type (void) G_GNUC_CONST;
static PhotoFileSniffer* jfif_file_format_driver_real_create_sniffer (PhotoFileFormatDriver* base, GFile* file, PhotoFileSnifferOptions options);
JfifSniffer* jfif_sniffer_new (GFile* file, PhotoFileSnifferOptions options);
JfifSniffer* jfif_sniffer_construct (GType object_type, GFile* file, PhotoFileSnifferOptions options);
GType gdk_sniffer_get_type (void) G_GNUC_CONST;
GType jfif_sniffer_get_type (void) G_GNUC_CONST;
PhotoFileFormatDriver* photo_file_format_driver_construct (GType object_type);
static void jfif_file_format_driver_finalize (PhotoFileFormatDriver* obj);
GType photo_file_format_get_type (void) G_GNUC_CONST;
GType photo_file_format_flags_get_type (void) G_GNUC_CONST;
enum  {
	JFIF_FILE_FORMAT_PROPERTIES_DUMMY_PROPERTY
};
JfifFileFormatProperties* jfif_file_format_properties_new (void);
JfifFileFormatProperties* jfif_file_format_properties_construct (GType object_type);
static PhotoFileFormat jfif_file_format_properties_real_get_file_format (PhotoFileFormatProperties* base);
static PhotoFileFormatFlags jfif_file_format_properties_real_get_flags (PhotoFileFormatProperties* base);
static gchar* jfif_file_format_properties_real_get_default_extension (PhotoFileFormatProperties* base);
static gchar* jfif_file_format_properties_real_get_user_visible_name (PhotoFileFormatProperties* base);
static gchar** jfif_file_format_properties_real_get_known_extensions (PhotoFileFormatProperties* base, int* result_length1);
static gchar** _vala_array_dup8 (gchar** self, int length);
static gchar* jfif_file_format_properties_real_get_default_mime_type (PhotoFileFormatProperties* base);
static gchar** jfif_file_format_properties_real_get_mime_types (PhotoFileFormatProperties* base, int* result_length1);
static gchar** _vala_array_dup9 (gchar** self, int length);
PhotoFileFormatProperties* photo_file_format_properties_construct (GType object_type);
static void jfif_file_format_properties_finalize (PhotoFileFormatProperties* obj);
gpointer detected_photo_information_ref (gpointer instance);
void detected_photo_information_unref (gpointer instance);
GParamSpec* param_spec_detected_photo_information (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_detected_photo_information (GValue* value, gpointer v_object);
void value_take_detected_photo_information (GValue* value, gpointer v_object);
gpointer value_get_detected_photo_information (const GValue* value);
GType detected_photo_information_get_type (void) G_GNUC_CONST;
enum  {
	JFIF_SNIFFER_DUMMY_PROPERTY
};
GdkSniffer* gdk_sniffer_construct (GType object_type, GFile* file, PhotoFileSnifferOptions options);
static DetectedPhotoInformation* jfif_sniffer_real_sniff (PhotoFileSniffer* base, gboolean* is_corrupted, GError** error);
gboolean jpeg_is_jpeg (GFile* file, GError** error);
DetectedPhotoInformation* photo_file_sniffer_sniff (PhotoFileSniffer* self, gboolean* is_corrupted, GError** error);
GType dimensions_get_type (void) G_GNUC_CONST;
Dimensions* dimensions_dup (const Dimensions* self);
void dimensions_free (Dimensions* self);
enum  {
	JFIF_READER_DUMMY_PROPERTY
};
GdkReader* gdk_reader_construct (GType object_type, const gchar* filepath, PhotoFileFormat file_format);
GType jpeg_quality_get_type (void) G_GNUC_CONST;
enum  {
	JFIF_WRITER_DUMMY_PROPERTY
};
PhotoFileWriter* photo_file_writer_construct (GType object_type, const gchar* filepath, PhotoFileFormat file_format);
static void jfif_writer_real_write (PhotoFileWriter* base, GdkPixbuf* pixbuf, JpegQuality quality, GError** error);
gchar* photo_file_adapter_get_filepath (PhotoFileAdapter* self);
gchar* jpeg_quality_get_pct_text (JpegQuality self);
enum  {
	JFIF_METADATA_WRITER_DUMMY_PROPERTY
};
PhotoFileMetadataWriter* photo_file_metadata_writer_construct (GType object_type, const gchar* filepath, PhotoFileFormat file_format);
static void jfif_metadata_writer_real_write_metadata (PhotoFileMetadataWriter* base, PhotoMetadata* metadata, GError** error);
void photo_metadata_write_to_file (PhotoMetadata* self, GFile* file, GError** error);
GFile* photo_file_adapter_get_file (PhotoFileAdapter* self);
#define JPEG_MARKER_PREFIX ((guint8) 0xFF)
GType jpeg_marker_get_type (void) G_GNUC_CONST;
guint8 jpeg_marker_get_byte (JpegMarker self);
gint jpeg_quality_get_pct (JpegQuality self);
JpegQuality* jpeg_quality_get_all (int* result_length1);
gchar* jpeg_quality_to_string (JpegQuality self);
gint jpeg_read_marker (GFileInputStream* fins, JpegMarker* marker, GError** error);


void jfif_file_format_driver_init (void) {
	JfifFileFormatDriver* _tmp0_ = NULL;
#line 11 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp0_ = jfif_file_format_driver_new ();
#line 11 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_photo_file_format_driver_unref0 (jfif_file_format_driver_instance);
#line 11 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	jfif_file_format_driver_instance = _tmp0_;
#line 12 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	jfif_file_format_properties_init ();
#line 633 "JfifSupport.c"
}


static gpointer _photo_file_format_driver_ref0 (gpointer self) {
#line 16 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	return self ? photo_file_format_driver_ref (self) : NULL;
#line 640 "JfifSupport.c"
}


JfifFileFormatDriver* jfif_file_format_driver_get_instance (void) {
	JfifFileFormatDriver* result = NULL;
	JfifFileFormatDriver* _tmp0_ = NULL;
	JfifFileFormatDriver* _tmp1_ = NULL;
#line 16 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp0_ = jfif_file_format_driver_instance;
#line 16 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp1_ = _photo_file_format_driver_ref0 (_tmp0_);
#line 16 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	result = _tmp1_;
#line 16 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	return result;
#line 656 "JfifSupport.c"
}


static PhotoFileFormatProperties* jfif_file_format_driver_real_get_properties (PhotoFileFormatDriver* base) {
	JfifFileFormatDriver * self;
	PhotoFileFormatProperties* result = NULL;
	JfifFileFormatProperties* _tmp0_ = NULL;
#line 19 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_JFIF_FILE_FORMAT_DRIVER, JfifFileFormatDriver);
#line 20 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp0_ = jfif_file_format_properties_get_instance ();
#line 20 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	result = G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, TYPE_PHOTO_FILE_FORMAT_PROPERTIES, PhotoFileFormatProperties);
#line 20 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	return result;
#line 672 "JfifSupport.c"
}


static PhotoFileReader* jfif_file_format_driver_real_create_reader (PhotoFileFormatDriver* base, const gchar* filepath) {
	JfifFileFormatDriver * self;
	PhotoFileReader* result = NULL;
	const gchar* _tmp0_ = NULL;
	JfifReader* _tmp1_ = NULL;
#line 23 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_JFIF_FILE_FORMAT_DRIVER, JfifFileFormatDriver);
#line 23 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	g_return_val_if_fail (filepath != NULL, NULL);
#line 24 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp0_ = filepath;
#line 24 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp1_ = jfif_reader_new (_tmp0_);
#line 24 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	result = G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_PHOTO_FILE_READER, PhotoFileReader);
#line 24 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	return result;
#line 693 "JfifSupport.c"
}


static PhotoMetadata* jfif_file_format_driver_real_create_metadata (PhotoFileFormatDriver* base) {
	JfifFileFormatDriver * self;
	PhotoMetadata* result = NULL;
	PhotoMetadata* _tmp0_ = NULL;
#line 27 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_JFIF_FILE_FORMAT_DRIVER, JfifFileFormatDriver);
#line 28 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp0_ = photo_metadata_new ();
#line 28 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	result = _tmp0_;
#line 28 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	return result;
#line 709 "JfifSupport.c"
}


static gboolean jfif_file_format_driver_real_can_write_image (PhotoFileFormatDriver* base) {
	JfifFileFormatDriver * self;
	gboolean result = FALSE;
#line 31 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_JFIF_FILE_FORMAT_DRIVER, JfifFileFormatDriver);
#line 32 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	result = TRUE;
#line 32 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	return result;
#line 722 "JfifSupport.c"
}


static gboolean jfif_file_format_driver_real_can_write_metadata (PhotoFileFormatDriver* base) {
	JfifFileFormatDriver * self;
	gboolean result = FALSE;
#line 35 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_JFIF_FILE_FORMAT_DRIVER, JfifFileFormatDriver);
#line 36 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	result = TRUE;
#line 36 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	return result;
#line 735 "JfifSupport.c"
}


static PhotoFileWriter* jfif_file_format_driver_real_create_writer (PhotoFileFormatDriver* base, const gchar* filepath) {
	JfifFileFormatDriver * self;
	PhotoFileWriter* result = NULL;
	const gchar* _tmp0_ = NULL;
	JfifWriter* _tmp1_ = NULL;
#line 39 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_JFIF_FILE_FORMAT_DRIVER, JfifFileFormatDriver);
#line 39 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	g_return_val_if_fail (filepath != NULL, NULL);
#line 40 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp0_ = filepath;
#line 40 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp1_ = jfif_writer_new (_tmp0_);
#line 40 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	result = G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_PHOTO_FILE_WRITER, PhotoFileWriter);
#line 40 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	return result;
#line 756 "JfifSupport.c"
}


static PhotoFileMetadataWriter* jfif_file_format_driver_real_create_metadata_writer (PhotoFileFormatDriver* base, const gchar* filepath) {
	JfifFileFormatDriver * self;
	PhotoFileMetadataWriter* result = NULL;
	const gchar* _tmp0_ = NULL;
	JfifMetadataWriter* _tmp1_ = NULL;
#line 43 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_JFIF_FILE_FORMAT_DRIVER, JfifFileFormatDriver);
#line 43 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	g_return_val_if_fail (filepath != NULL, NULL);
#line 44 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp0_ = filepath;
#line 44 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp1_ = jfif_metadata_writer_new (_tmp0_);
#line 44 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	result = G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_PHOTO_FILE_METADATA_WRITER, PhotoFileMetadataWriter);
#line 44 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	return result;
#line 777 "JfifSupport.c"
}


static PhotoFileSniffer* jfif_file_format_driver_real_create_sniffer (PhotoFileFormatDriver* base, GFile* file, PhotoFileSnifferOptions options) {
	JfifFileFormatDriver * self;
	PhotoFileSniffer* result = NULL;
	GFile* _tmp0_ = NULL;
	PhotoFileSnifferOptions _tmp1_ = 0;
	JfifSniffer* _tmp2_ = NULL;
#line 47 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_JFIF_FILE_FORMAT_DRIVER, JfifFileFormatDriver);
#line 47 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	g_return_val_if_fail (G_IS_FILE (file), NULL);
#line 48 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp0_ = file;
#line 48 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp1_ = options;
#line 48 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp2_ = jfif_sniffer_new (_tmp0_, _tmp1_);
#line 48 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	result = G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, TYPE_PHOTO_FILE_SNIFFER, PhotoFileSniffer);
#line 48 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	return result;
#line 801 "JfifSupport.c"
}


JfifFileFormatDriver* jfif_file_format_driver_construct (GType object_type) {
	JfifFileFormatDriver* self = NULL;
#line 7 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	self = (JfifFileFormatDriver*) photo_file_format_driver_construct (object_type);
#line 7 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	return self;
#line 811 "JfifSupport.c"
}


JfifFileFormatDriver* jfif_file_format_driver_new (void) {
#line 7 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	return jfif_file_format_driver_construct (TYPE_JFIF_FILE_FORMAT_DRIVER);
#line 818 "JfifSupport.c"
}


static void jfif_file_format_driver_class_init (JfifFileFormatDriverClass * klass) {
#line 7 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	jfif_file_format_driver_parent_class = g_type_class_peek_parent (klass);
#line 7 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	((PhotoFileFormatDriverClass *) klass)->finalize = jfif_file_format_driver_finalize;
#line 7 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	((PhotoFileFormatDriverClass *) klass)->get_properties = (PhotoFileFormatProperties* (*)(PhotoFileFormatDriver*)) jfif_file_format_driver_real_get_properties;
#line 7 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	((PhotoFileFormatDriverClass *) klass)->create_reader = (PhotoFileReader* (*)(PhotoFileFormatDriver*, const gchar*)) jfif_file_format_driver_real_create_reader;
#line 7 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	((PhotoFileFormatDriverClass *) klass)->create_metadata = (PhotoMetadata* (*)(PhotoFileFormatDriver*)) jfif_file_format_driver_real_create_metadata;
#line 7 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	((PhotoFileFormatDriverClass *) klass)->can_write_image = (gboolean (*)(PhotoFileFormatDriver*)) jfif_file_format_driver_real_can_write_image;
#line 7 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	((PhotoFileFormatDriverClass *) klass)->can_write_metadata = (gboolean (*)(PhotoFileFormatDriver*)) jfif_file_format_driver_real_can_write_metadata;
#line 7 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	((PhotoFileFormatDriverClass *) klass)->create_writer = (PhotoFileWriter* (*)(PhotoFileFormatDriver*, const gchar*)) jfif_file_format_driver_real_create_writer;
#line 7 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	((PhotoFileFormatDriverClass *) klass)->create_metadata_writer = (PhotoFileMetadataWriter* (*)(PhotoFileFormatDriver*, const gchar*)) jfif_file_format_driver_real_create_metadata_writer;
#line 7 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	((PhotoFileFormatDriverClass *) klass)->create_sniffer = (PhotoFileSniffer* (*)(PhotoFileFormatDriver*, GFile*, PhotoFileSnifferOptions)) jfif_file_format_driver_real_create_sniffer;
#line 843 "JfifSupport.c"
}


static void jfif_file_format_driver_instance_init (JfifFileFormatDriver * self) {
}


static void jfif_file_format_driver_finalize (PhotoFileFormatDriver* obj) {
	JfifFileFormatDriver * self;
#line 7 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_JFIF_FILE_FORMAT_DRIVER, JfifFileFormatDriver);
#line 7 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	PHOTO_FILE_FORMAT_DRIVER_CLASS (jfif_file_format_driver_parent_class)->finalize (obj);
#line 857 "JfifSupport.c"
}


GType jfif_file_format_driver_get_type (void) {
	static volatile gsize jfif_file_format_driver_type_id__volatile = 0;
	if (g_once_init_enter (&jfif_file_format_driver_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (JfifFileFormatDriverClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) jfif_file_format_driver_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (JfifFileFormatDriver), 0, (GInstanceInitFunc) jfif_file_format_driver_instance_init, NULL };
		GType jfif_file_format_driver_type_id;
		jfif_file_format_driver_type_id = g_type_register_static (TYPE_PHOTO_FILE_FORMAT_DRIVER, "JfifFileFormatDriver", &g_define_type_info, 0);
		g_once_init_leave (&jfif_file_format_driver_type_id__volatile, jfif_file_format_driver_type_id);
	}
	return jfif_file_format_driver_type_id__volatile;
}


void jfif_file_format_properties_init (void) {
	JfifFileFormatProperties* _tmp0_ = NULL;
#line 64 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp0_ = jfif_file_format_properties_new ();
#line 64 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_photo_file_format_properties_unref0 (jfif_file_format_properties_instance);
#line 64 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	jfif_file_format_properties_instance = _tmp0_;
#line 881 "JfifSupport.c"
}


static gpointer _photo_file_format_properties_ref0 (gpointer self) {
#line 68 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	return self ? photo_file_format_properties_ref (self) : NULL;
#line 888 "JfifSupport.c"
}


JfifFileFormatProperties* jfif_file_format_properties_get_instance (void) {
	JfifFileFormatProperties* result = NULL;
	JfifFileFormatProperties* _tmp0_ = NULL;
	JfifFileFormatProperties* _tmp1_ = NULL;
#line 68 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp0_ = jfif_file_format_properties_instance;
#line 68 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp1_ = _photo_file_format_properties_ref0 (_tmp0_);
#line 68 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	result = _tmp1_;
#line 68 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	return result;
#line 904 "JfifSupport.c"
}


static PhotoFileFormat jfif_file_format_properties_real_get_file_format (PhotoFileFormatProperties* base) {
	JfifFileFormatProperties * self;
	PhotoFileFormat result = 0;
#line 71 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_JFIF_FILE_FORMAT_PROPERTIES, JfifFileFormatProperties);
#line 72 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	result = PHOTO_FILE_FORMAT_JFIF;
#line 72 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	return result;
#line 917 "JfifSupport.c"
}


static PhotoFileFormatFlags jfif_file_format_properties_real_get_flags (PhotoFileFormatProperties* base) {
	JfifFileFormatProperties * self;
	PhotoFileFormatFlags result = 0;
#line 75 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_JFIF_FILE_FORMAT_PROPERTIES, JfifFileFormatProperties);
#line 76 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	result = PHOTO_FILE_FORMAT_FLAGS_NONE;
#line 76 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	return result;
#line 930 "JfifSupport.c"
}


static gchar* jfif_file_format_properties_real_get_default_extension (PhotoFileFormatProperties* base) {
	JfifFileFormatProperties * self;
	gchar* result = NULL;
	gchar* _tmp0_ = NULL;
#line 79 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_JFIF_FILE_FORMAT_PROPERTIES, JfifFileFormatProperties);
#line 80 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp0_ = g_strdup ("jpg");
#line 80 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	result = _tmp0_;
#line 80 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	return result;
#line 946 "JfifSupport.c"
}


static gchar* jfif_file_format_properties_real_get_user_visible_name (PhotoFileFormatProperties* base) {
	JfifFileFormatProperties * self;
	gchar* result = NULL;
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
#line 83 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_JFIF_FILE_FORMAT_PROPERTIES, JfifFileFormatProperties);
#line 84 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp0_ = _ ("JPEG");
#line 84 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp1_ = g_strdup (_tmp0_);
#line 84 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	result = _tmp1_;
#line 84 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	return result;
#line 965 "JfifSupport.c"
}


static gchar** _vala_array_dup8 (gchar** self, int length) {
	gchar** result;
	int i;
#line 88 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	result = g_new0 (gchar*, length + 1);
#line 88 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	for (i = 0; i < length; i++) {
#line 976 "JfifSupport.c"
		gchar* _tmp0_ = NULL;
#line 88 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		_tmp0_ = g_strdup (self[i]);
#line 88 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		result[i] = _tmp0_;
#line 982 "JfifSupport.c"
	}
#line 88 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	return result;
#line 986 "JfifSupport.c"
}


static gchar** jfif_file_format_properties_real_get_known_extensions (PhotoFileFormatProperties* base, int* result_length1) {
	JfifFileFormatProperties * self;
	gchar** result = NULL;
	gchar** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	gchar** _tmp1_ = NULL;
	gint _tmp1__length1 = 0;
	gchar** _tmp2_ = NULL;
	gint _tmp2__length1 = 0;
#line 87 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_JFIF_FILE_FORMAT_PROPERTIES, JfifFileFormatProperties);
#line 88 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp0_ = jfif_file_format_properties_KNOWN_EXTENSIONS;
#line 88 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp0__length1 = jfif_file_format_properties_KNOWN_EXTENSIONS_length1;
#line 88 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp1_ = (_tmp0_ != NULL) ? _vala_array_dup8 (_tmp0_, _tmp0__length1) : ((gpointer) _tmp0_);
#line 88 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp1__length1 = _tmp0__length1;
#line 88 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp2_ = _tmp1_;
#line 88 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp2__length1 = _tmp1__length1;
#line 88 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	if (result_length1) {
#line 88 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		*result_length1 = _tmp2__length1;
#line 1017 "JfifSupport.c"
	}
#line 88 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	result = _tmp2_;
#line 88 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	return result;
#line 1023 "JfifSupport.c"
}


static gchar* jfif_file_format_properties_real_get_default_mime_type (PhotoFileFormatProperties* base) {
	JfifFileFormatProperties * self;
	gchar* result = NULL;
	gchar** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	const gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
#line 91 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_JFIF_FILE_FORMAT_PROPERTIES, JfifFileFormatProperties);
#line 92 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp0_ = jfif_file_format_properties_KNOWN_MIME_TYPES;
#line 92 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp0__length1 = jfif_file_format_properties_KNOWN_MIME_TYPES_length1;
#line 92 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp1_ = _tmp0_[0];
#line 92 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp2_ = g_strdup (_tmp1_);
#line 92 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	result = _tmp2_;
#line 92 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	return result;
#line 1048 "JfifSupport.c"
}


static gchar** _vala_array_dup9 (gchar** self, int length) {
	gchar** result;
	int i;
#line 96 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	result = g_new0 (gchar*, length + 1);
#line 96 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	for (i = 0; i < length; i++) {
#line 1059 "JfifSupport.c"
		gchar* _tmp0_ = NULL;
#line 96 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		_tmp0_ = g_strdup (self[i]);
#line 96 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		result[i] = _tmp0_;
#line 1065 "JfifSupport.c"
	}
#line 96 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	return result;
#line 1069 "JfifSupport.c"
}


static gchar** jfif_file_format_properties_real_get_mime_types (PhotoFileFormatProperties* base, int* result_length1) {
	JfifFileFormatProperties * self;
	gchar** result = NULL;
	gchar** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	gchar** _tmp1_ = NULL;
	gint _tmp1__length1 = 0;
	gchar** _tmp2_ = NULL;
	gint _tmp2__length1 = 0;
#line 95 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_JFIF_FILE_FORMAT_PROPERTIES, JfifFileFormatProperties);
#line 96 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp0_ = jfif_file_format_properties_KNOWN_MIME_TYPES;
#line 96 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp0__length1 = jfif_file_format_properties_KNOWN_MIME_TYPES_length1;
#line 96 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp1_ = (_tmp0_ != NULL) ? _vala_array_dup9 (_tmp0_, _tmp0__length1) : ((gpointer) _tmp0_);
#line 96 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp1__length1 = _tmp0__length1;
#line 96 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp2_ = _tmp1_;
#line 96 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp2__length1 = _tmp1__length1;
#line 96 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	if (result_length1) {
#line 96 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		*result_length1 = _tmp2__length1;
#line 1100 "JfifSupport.c"
	}
#line 96 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	result = _tmp2_;
#line 96 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	return result;
#line 1106 "JfifSupport.c"
}


JfifFileFormatProperties* jfif_file_format_properties_construct (GType object_type) {
	JfifFileFormatProperties* self = NULL;
#line 52 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	self = (JfifFileFormatProperties*) photo_file_format_properties_construct (object_type);
#line 52 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	return self;
#line 1116 "JfifSupport.c"
}


JfifFileFormatProperties* jfif_file_format_properties_new (void) {
#line 52 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	return jfif_file_format_properties_construct (TYPE_JFIF_FILE_FORMAT_PROPERTIES);
#line 1123 "JfifSupport.c"
}


static void jfif_file_format_properties_class_init (JfifFileFormatPropertiesClass * klass) {
	gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	gchar** _tmp4_ = NULL;
	gchar* _tmp5_ = NULL;
	gchar** _tmp6_ = NULL;
#line 52 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	jfif_file_format_properties_parent_class = g_type_class_peek_parent (klass);
#line 52 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	((PhotoFileFormatPropertiesClass *) klass)->finalize = jfif_file_format_properties_finalize;
#line 52 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	((PhotoFileFormatPropertiesClass *) klass)->get_file_format = (PhotoFileFormat (*)(PhotoFileFormatProperties*)) jfif_file_format_properties_real_get_file_format;
#line 52 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	((PhotoFileFormatPropertiesClass *) klass)->get_flags = (PhotoFileFormatFlags (*)(PhotoFileFormatProperties*)) jfif_file_format_properties_real_get_flags;
#line 52 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	((PhotoFileFormatPropertiesClass *) klass)->get_default_extension = (gchar* (*)(PhotoFileFormatProperties*)) jfif_file_format_properties_real_get_default_extension;
#line 52 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	((PhotoFileFormatPropertiesClass *) klass)->get_user_visible_name = (gchar* (*)(PhotoFileFormatProperties*)) jfif_file_format_properties_real_get_user_visible_name;
#line 52 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	((PhotoFileFormatPropertiesClass *) klass)->get_known_extensions = (gchar** (*)(PhotoFileFormatProperties*, int*)) jfif_file_format_properties_real_get_known_extensions;
#line 52 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	((PhotoFileFormatPropertiesClass *) klass)->get_default_mime_type = (gchar* (*)(PhotoFileFormatProperties*)) jfif_file_format_properties_real_get_default_mime_type;
#line 52 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	((PhotoFileFormatPropertiesClass *) klass)->get_mime_types = (gchar** (*)(PhotoFileFormatProperties*, int*)) jfif_file_format_properties_real_get_mime_types;
#line 53 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp0_ = g_strdup ("jpg");
#line 53 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp1_ = g_strdup ("jpeg");
#line 53 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp2_ = g_strdup ("jpe");
#line 53 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp3_ = g_strdup ("thm");
#line 53 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp4_ = g_new0 (gchar*, 4 + 1);
#line 53 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp4_[0] = _tmp0_;
#line 53 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp4_[1] = _tmp1_;
#line 53 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp4_[2] = _tmp2_;
#line 53 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp4_[3] = _tmp3_;
#line 53 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	jfif_file_format_properties_KNOWN_EXTENSIONS = _tmp4_;
#line 53 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	jfif_file_format_properties_KNOWN_EXTENSIONS_length1 = 4;
#line 57 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp5_ = g_strdup ("image/jpeg");
#line 57 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp6_ = g_new0 (gchar*, 1 + 1);
#line 57 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp6_[0] = _tmp5_;
#line 57 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	jfif_file_format_properties_KNOWN_MIME_TYPES = _tmp6_;
#line 57 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	jfif_file_format_properties_KNOWN_MIME_TYPES_length1 = 1;
#line 1185 "JfifSupport.c"
}


static void jfif_file_format_properties_instance_init (JfifFileFormatProperties * self) {
}


static void jfif_file_format_properties_finalize (PhotoFileFormatProperties* obj) {
	JfifFileFormatProperties * self;
#line 52 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_JFIF_FILE_FORMAT_PROPERTIES, JfifFileFormatProperties);
#line 52 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	PHOTO_FILE_FORMAT_PROPERTIES_CLASS (jfif_file_format_properties_parent_class)->finalize (obj);
#line 1199 "JfifSupport.c"
}


GType jfif_file_format_properties_get_type (void) {
	static volatile gsize jfif_file_format_properties_type_id__volatile = 0;
	if (g_once_init_enter (&jfif_file_format_properties_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (JfifFileFormatPropertiesClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) jfif_file_format_properties_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (JfifFileFormatProperties), 0, (GInstanceInitFunc) jfif_file_format_properties_instance_init, NULL };
		GType jfif_file_format_properties_type_id;
		jfif_file_format_properties_type_id = g_type_register_static (TYPE_PHOTO_FILE_FORMAT_PROPERTIES, "JfifFileFormatProperties", &g_define_type_info, 0);
		g_once_init_leave (&jfif_file_format_properties_type_id__volatile, jfif_file_format_properties_type_id);
	}
	return jfif_file_format_properties_type_id__volatile;
}


JfifSniffer* jfif_sniffer_construct (GType object_type, GFile* file, PhotoFileSnifferOptions options) {
	JfifSniffer* self = NULL;
	GFile* _tmp0_ = NULL;
	PhotoFileSnifferOptions _tmp1_ = 0;
#line 101 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	g_return_val_if_fail (G_IS_FILE (file), NULL);
#line 102 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp0_ = file;
#line 102 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp1_ = options;
#line 102 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	self = (JfifSniffer*) gdk_sniffer_construct (object_type, _tmp0_, _tmp1_);
#line 101 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	return self;
#line 1229 "JfifSupport.c"
}


JfifSniffer* jfif_sniffer_new (GFile* file, PhotoFileSnifferOptions options) {
#line 101 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	return jfif_sniffer_construct (TYPE_JFIF_SNIFFER, file, options);
#line 1236 "JfifSupport.c"
}


static gpointer _detected_photo_information_ref0 (gpointer self) {
#line 116 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	return self ? detected_photo_information_ref (self) : NULL;
#line 1243 "JfifSupport.c"
}


static DetectedPhotoInformation* jfif_sniffer_real_sniff (PhotoFileSniffer* base, gboolean* is_corrupted, GError** error) {
	JfifSniffer * self;
	gboolean _vala_is_corrupted = FALSE;
	DetectedPhotoInformation* result = NULL;
	gboolean _tmp0_ = FALSE;
	GFile* _tmp1_ = NULL;
	gboolean _tmp2_ = FALSE;
	DetectedPhotoInformation* detected = NULL;
	gboolean _tmp3_ = FALSE;
	DetectedPhotoInformation* _tmp4_ = NULL;
	DetectedPhotoInformation* _tmp5_ = NULL;
	DetectedPhotoInformation* _tmp6_ = NULL;
	DetectedPhotoInformation* _tmp7_ = NULL;
	PhotoFileFormat _tmp8_ = 0;
	DetectedPhotoInformation* _tmp10_ = NULL;
	GError * _inner_error_ = NULL;
#line 105 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_JFIF_SNIFFER, JfifSniffer);
#line 107 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_vala_is_corrupted = FALSE;
#line 109 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp1_ = G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PHOTO_FILE_SNIFFER, PhotoFileSniffer)->file;
#line 109 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp2_ = jpeg_is_jpeg (_tmp1_, &_inner_error_);
#line 109 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp0_ = _tmp2_;
#line 109 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 109 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		g_propagate_error (error, _inner_error_);
#line 109 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		return NULL;
#line 1279 "JfifSupport.c"
	}
#line 109 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	if (!_tmp0_) {
#line 110 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		result = NULL;
#line 110 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		if (is_corrupted) {
#line 110 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
			*is_corrupted = _vala_is_corrupted;
#line 1289 "JfifSupport.c"
		}
#line 110 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		return result;
#line 1293 "JfifSupport.c"
	}
#line 112 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp4_ = PHOTO_FILE_SNIFFER_CLASS (jfif_sniffer_parent_class)->sniff (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_GDK_SNIFFER, GdkSniffer), TYPE_PHOTO_FILE_SNIFFER, PhotoFileSniffer), &_tmp3_, &_inner_error_);
#line 112 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_vala_is_corrupted = _tmp3_;
#line 112 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	detected = _tmp4_;
#line 112 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 112 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		g_propagate_error (error, _inner_error_);
#line 112 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		return NULL;
#line 1307 "JfifSupport.c"
	}
#line 113 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp5_ = detected;
#line 113 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	if (_tmp5_ == NULL) {
#line 114 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		result = NULL;
#line 114 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		_detected_photo_information_unref0 (detected);
#line 114 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		if (is_corrupted) {
#line 114 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
			*is_corrupted = _vala_is_corrupted;
#line 1321 "JfifSupport.c"
		}
#line 114 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		return result;
#line 1325 "JfifSupport.c"
	}
#line 116 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp7_ = detected;
#line 116 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp8_ = _tmp7_->file_format;
#line 116 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	if (_tmp8_ == PHOTO_FILE_FORMAT_JFIF) {
#line 1333 "JfifSupport.c"
		DetectedPhotoInformation* _tmp9_ = NULL;
#line 116 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		_tmp9_ = detected;
#line 116 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		_tmp6_ = _tmp9_;
#line 1339 "JfifSupport.c"
	} else {
#line 116 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		_tmp6_ = NULL;
#line 1343 "JfifSupport.c"
	}
#line 116 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp10_ = _detected_photo_information_ref0 (_tmp6_);
#line 116 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	result = _tmp10_;
#line 116 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_detected_photo_information_unref0 (detected);
#line 116 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	if (is_corrupted) {
#line 116 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		*is_corrupted = _vala_is_corrupted;
#line 1355 "JfifSupport.c"
	}
#line 116 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	return result;
#line 1359 "JfifSupport.c"
}


static void jfif_sniffer_class_init (JfifSnifferClass * klass) {
#line 100 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	jfif_sniffer_parent_class = g_type_class_peek_parent (klass);
#line 100 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	((PhotoFileSnifferClass *) klass)->sniff = (DetectedPhotoInformation* (*)(PhotoFileSniffer*, gboolean*, GError**)) jfif_sniffer_real_sniff;
#line 1368 "JfifSupport.c"
}


static void jfif_sniffer_instance_init (JfifSniffer * self) {
}


GType jfif_sniffer_get_type (void) {
	static volatile gsize jfif_sniffer_type_id__volatile = 0;
	if (g_once_init_enter (&jfif_sniffer_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (JfifSnifferClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) jfif_sniffer_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (JfifSniffer), 0, (GInstanceInitFunc) jfif_sniffer_instance_init, NULL };
		GType jfif_sniffer_type_id;
		jfif_sniffer_type_id = g_type_register_static (TYPE_GDK_SNIFFER, "JfifSniffer", &g_define_type_info, 0);
		g_once_init_leave (&jfif_sniffer_type_id__volatile, jfif_sniffer_type_id);
	}
	return jfif_sniffer_type_id__volatile;
}


JfifReader* jfif_reader_construct (GType object_type, const gchar* filepath) {
	JfifReader* self = NULL;
	const gchar* _tmp0_ = NULL;
#line 121 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	g_return_val_if_fail (filepath != NULL, NULL);
#line 122 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp0_ = filepath;
#line 122 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	self = (JfifReader*) gdk_reader_construct (object_type, _tmp0_, PHOTO_FILE_FORMAT_JFIF);
#line 121 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	return self;
#line 1399 "JfifSupport.c"
}


JfifReader* jfif_reader_new (const gchar* filepath) {
#line 121 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	return jfif_reader_construct (TYPE_JFIF_READER, filepath);
#line 1406 "JfifSupport.c"
}


static void jfif_reader_class_init (JfifReaderClass * klass) {
#line 120 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	jfif_reader_parent_class = g_type_class_peek_parent (klass);
#line 1413 "JfifSupport.c"
}


static void jfif_reader_instance_init (JfifReader * self) {
}


GType jfif_reader_get_type (void) {
	static volatile gsize jfif_reader_type_id__volatile = 0;
	if (g_once_init_enter (&jfif_reader_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (JfifReaderClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) jfif_reader_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (JfifReader), 0, (GInstanceInitFunc) jfif_reader_instance_init, NULL };
		GType jfif_reader_type_id;
		jfif_reader_type_id = g_type_register_static (TYPE_GDK_READER, "JfifReader", &g_define_type_info, 0);
		g_once_init_leave (&jfif_reader_type_id__volatile, jfif_reader_type_id);
	}
	return jfif_reader_type_id__volatile;
}


JfifWriter* jfif_writer_construct (GType object_type, const gchar* filepath) {
	JfifWriter* self = NULL;
	const gchar* _tmp0_ = NULL;
#line 127 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	g_return_val_if_fail (filepath != NULL, NULL);
#line 128 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp0_ = filepath;
#line 128 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	self = (JfifWriter*) photo_file_writer_construct (object_type, _tmp0_, PHOTO_FILE_FORMAT_JFIF);
#line 127 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	return self;
#line 1444 "JfifSupport.c"
}


JfifWriter* jfif_writer_new (const gchar* filepath) {
#line 127 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	return jfif_writer_construct (TYPE_JFIF_WRITER, filepath);
#line 1451 "JfifSupport.c"
}


static void jfif_writer_real_write (PhotoFileWriter* base, GdkPixbuf* pixbuf, JpegQuality quality, GError** error) {
	JfifWriter * self;
	GdkPixbuf* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	JpegQuality _tmp3_ = 0;
	gchar* _tmp4_ = NULL;
	gchar* _tmp5_ = NULL;
	GError * _inner_error_ = NULL;
#line 131 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_JFIF_WRITER, JfifWriter);
#line 131 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	g_return_if_fail (GDK_IS_PIXBUF (pixbuf));
#line 132 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp0_ = pixbuf;
#line 132 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp1_ = photo_file_adapter_get_filepath (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter));
#line 132 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp2_ = _tmp1_;
#line 132 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp3_ = quality;
#line 132 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp4_ = jpeg_quality_get_pct_text (_tmp3_);
#line 132 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp5_ = _tmp4_;
#line 132 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	gdk_pixbuf_save (_tmp0_, _tmp2_, "jpeg", &_inner_error_, "quality", _tmp5_, NULL);
#line 132 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_g_free0 (_tmp5_);
#line 132 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_g_free0 (_tmp2_);
#line 132 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 132 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		g_propagate_error (error, _inner_error_);
#line 132 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		return;
#line 1492 "JfifSupport.c"
	}
}


static void jfif_writer_class_init (JfifWriterClass * klass) {
#line 126 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	jfif_writer_parent_class = g_type_class_peek_parent (klass);
#line 126 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	((PhotoFileWriterClass *) klass)->write = (void (*)(PhotoFileWriter*, GdkPixbuf*, JpegQuality, GError**)) jfif_writer_real_write;
#line 1502 "JfifSupport.c"
}


static void jfif_writer_instance_init (JfifWriter * self) {
}


GType jfif_writer_get_type (void) {
	static volatile gsize jfif_writer_type_id__volatile = 0;
	if (g_once_init_enter (&jfif_writer_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (JfifWriterClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) jfif_writer_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (JfifWriter), 0, (GInstanceInitFunc) jfif_writer_instance_init, NULL };
		GType jfif_writer_type_id;
		jfif_writer_type_id = g_type_register_static (TYPE_PHOTO_FILE_WRITER, "JfifWriter", &g_define_type_info, 0);
		g_once_init_leave (&jfif_writer_type_id__volatile, jfif_writer_type_id);
	}
	return jfif_writer_type_id__volatile;
}


JfifMetadataWriter* jfif_metadata_writer_construct (GType object_type, const gchar* filepath) {
	JfifMetadataWriter* self = NULL;
	const gchar* _tmp0_ = NULL;
#line 137 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	g_return_val_if_fail (filepath != NULL, NULL);
#line 138 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp0_ = filepath;
#line 138 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	self = (JfifMetadataWriter*) photo_file_metadata_writer_construct (object_type, _tmp0_, PHOTO_FILE_FORMAT_JFIF);
#line 137 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	return self;
#line 1533 "JfifSupport.c"
}


JfifMetadataWriter* jfif_metadata_writer_new (const gchar* filepath) {
#line 137 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	return jfif_metadata_writer_construct (TYPE_JFIF_METADATA_WRITER, filepath);
#line 1540 "JfifSupport.c"
}


static void jfif_metadata_writer_real_write_metadata (PhotoFileMetadataWriter* base, PhotoMetadata* metadata, GError** error) {
	JfifMetadataWriter * self;
	PhotoMetadata* _tmp0_ = NULL;
	GFile* _tmp1_ = NULL;
	GFile* _tmp2_ = NULL;
	GError * _inner_error_ = NULL;
#line 141 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_JFIF_METADATA_WRITER, JfifMetadataWriter);
#line 141 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	g_return_if_fail (IS_PHOTO_METADATA (metadata));
#line 142 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp0_ = metadata;
#line 142 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp1_ = photo_file_adapter_get_file (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter));
#line 142 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp2_ = _tmp1_;
#line 142 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	photo_metadata_write_to_file (_tmp0_, _tmp2_, &_inner_error_);
#line 142 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_g_object_unref0 (_tmp2_);
#line 142 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 142 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		g_propagate_error (error, _inner_error_);
#line 142 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		return;
#line 1570 "JfifSupport.c"
	}
}


static void jfif_metadata_writer_class_init (JfifMetadataWriterClass * klass) {
#line 136 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	jfif_metadata_writer_parent_class = g_type_class_peek_parent (klass);
#line 136 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	((PhotoFileMetadataWriterClass *) klass)->write_metadata = (void (*)(PhotoFileMetadataWriter*, PhotoMetadata*, GError**)) jfif_metadata_writer_real_write_metadata;
#line 1580 "JfifSupport.c"
}


static void jfif_metadata_writer_instance_init (JfifMetadataWriter * self) {
}


GType jfif_metadata_writer_get_type (void) {
	static volatile gsize jfif_metadata_writer_type_id__volatile = 0;
	if (g_once_init_enter (&jfif_metadata_writer_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (JfifMetadataWriterClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) jfif_metadata_writer_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (JfifMetadataWriter), 0, (GInstanceInitFunc) jfif_metadata_writer_instance_init, NULL };
		GType jfif_metadata_writer_type_id;
		jfif_metadata_writer_type_id = g_type_register_static (TYPE_PHOTO_FILE_METADATA_WRITER, "JfifMetadataWriter", &g_define_type_info, 0);
		g_once_init_leave (&jfif_metadata_writer_type_id__volatile, jfif_metadata_writer_type_id);
	}
	return jfif_metadata_writer_type_id__volatile;
}


guint8 jpeg_marker_get_byte (JpegMarker self) {
	guint8 result = 0U;
#line 160 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	result = (guint8) self;
#line 160 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	return result;
#line 1606 "JfifSupport.c"
}


GType jpeg_marker_get_type (void) {
	static volatile gsize jpeg_marker_type_id__volatile = 0;
	if (g_once_init_enter (&jpeg_marker_type_id__volatile)) {
		static const GEnumValue values[] = {{JPEG_MARKER_INVALID, "JPEG_MARKER_INVALID", "invalid"}, {JPEG_MARKER_SOI, "JPEG_MARKER_SOI", "soi"}, {JPEG_MARKER_EOI, "JPEG_MARKER_EOI", "eoi"}, {JPEG_MARKER_APP0, "JPEG_MARKER_APP0", "app0"}, {JPEG_MARKER_APP1, "JPEG_MARKER_APP1", "app1"}, {0, NULL, NULL}};
		GType jpeg_marker_type_id;
		jpeg_marker_type_id = g_enum_register_static ("JpegMarker", values);
		g_once_init_leave (&jpeg_marker_type_id__volatile, jpeg_marker_type_id);
	}
	return jpeg_marker_type_id__volatile;
}


gint jpeg_quality_get_pct (JpegQuality self) {
	gint result = 0;
#line 171 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	result = (gint) self;
#line 171 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	return result;
#line 1628 "JfifSupport.c"
}


gchar* jpeg_quality_get_pct_text (JpegQuality self) {
	gchar* result = NULL;
	gchar* _tmp0_ = NULL;
#line 175 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp0_ = g_strdup_printf ("%d", (gint) self);
#line 175 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	result = _tmp0_;
#line 175 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	return result;
#line 1641 "JfifSupport.c"
}


JpegQuality* jpeg_quality_get_all (int* result_length1) {
	JpegQuality* result = NULL;
	JpegQuality* _tmp0_ = NULL;
	JpegQuality* _tmp1_ = NULL;
	gint _tmp1__length1 = 0;
#line 179 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp0_ = g_new0 (JpegQuality, 4);
#line 179 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp0_[0] = JPEG_QUALITY_LOW;
#line 179 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp0_[1] = JPEG_QUALITY_MEDIUM;
#line 179 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp0_[2] = JPEG_QUALITY_HIGH;
#line 179 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp0_[3] = JPEG_QUALITY_MAXIMUM;
#line 179 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp1_ = _tmp0_;
#line 179 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp1__length1 = 4;
#line 179 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	if (result_length1) {
#line 179 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		*result_length1 = _tmp1__length1;
#line 1668 "JfifSupport.c"
	}
#line 179 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	result = _tmp1_;
#line 179 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	return result;
#line 1674 "JfifSupport.c"
}


gchar* jpeg_quality_to_string (JpegQuality self) {
	gchar* result = NULL;
#line 183 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	switch (self) {
#line 183 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		case JPEG_QUALITY_LOW:
#line 1684 "JfifSupport.c"
		{
			const gchar* _tmp0_ = NULL;
			gchar* _tmp1_ = NULL;
#line 185 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
			_tmp0_ = _ ("Low (%d%%)");
#line 185 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
			_tmp1_ = g_strdup_printf (_tmp0_, (gint) self);
#line 185 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
			result = _tmp1_;
#line 185 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
			return result;
#line 1696 "JfifSupport.c"
		}
#line 183 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		case JPEG_QUALITY_MEDIUM:
#line 1700 "JfifSupport.c"
		{
			const gchar* _tmp2_ = NULL;
			gchar* _tmp3_ = NULL;
#line 188 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
			_tmp2_ = _ ("Medium (%d%%)");
#line 188 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
			_tmp3_ = g_strdup_printf (_tmp2_, (gint) self);
#line 188 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
			result = _tmp3_;
#line 188 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
			return result;
#line 1712 "JfifSupport.c"
		}
#line 183 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		case JPEG_QUALITY_HIGH:
#line 1716 "JfifSupport.c"
		{
			const gchar* _tmp4_ = NULL;
			gchar* _tmp5_ = NULL;
#line 191 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
			_tmp4_ = _ ("High (%d%%)");
#line 191 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
			_tmp5_ = g_strdup_printf (_tmp4_, (gint) self);
#line 191 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
			result = _tmp5_;
#line 191 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
			return result;
#line 1728 "JfifSupport.c"
		}
#line 183 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		case JPEG_QUALITY_MAXIMUM:
#line 1732 "JfifSupport.c"
		{
			const gchar* _tmp6_ = NULL;
			gchar* _tmp7_ = NULL;
#line 194 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
			_tmp6_ = _ ("Maximum (%d%%)");
#line 194 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
			_tmp7_ = g_strdup_printf (_tmp6_, (gint) self);
#line 194 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
			result = _tmp7_;
#line 194 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
			return result;
#line 1744 "JfifSupport.c"
		}
		default:
#line 183 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		break;
#line 1749 "JfifSupport.c"
	}
#line 197 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	g_warn_if_reached ();
#line 199 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	result = NULL;
#line 199 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	return result;
#line 1757 "JfifSupport.c"
}


GType jpeg_quality_get_type (void) {
	static volatile gsize jpeg_quality_type_id__volatile = 0;
	if (g_once_init_enter (&jpeg_quality_type_id__volatile)) {
		static const GEnumValue values[] = {{JPEG_QUALITY_LOW, "JPEG_QUALITY_LOW", "low"}, {JPEG_QUALITY_MEDIUM, "JPEG_QUALITY_MEDIUM", "medium"}, {JPEG_QUALITY_HIGH, "JPEG_QUALITY_HIGH", "high"}, {JPEG_QUALITY_MAXIMUM, "JPEG_QUALITY_MAXIMUM", "maximum"}, {0, NULL, NULL}};
		GType jpeg_quality_type_id;
		jpeg_quality_type_id = g_enum_register_static ("JpegQuality", values);
		g_once_init_leave (&jpeg_quality_type_id__volatile, jpeg_quality_type_id);
	}
	return jpeg_quality_type_id__volatile;
}


gboolean jpeg_is_jpeg (GFile* file, GError** error) {
	gboolean result = FALSE;
	GFileInputStream* fins = NULL;
	GFile* _tmp0_ = NULL;
	GFileInputStream* _tmp1_ = NULL;
	JpegMarker marker = 0;
	gint segment_length = 0;
	GFileInputStream* _tmp3_ = NULL;
	JpegMarker _tmp4_ = 0;
	gint _tmp5_ = 0;
	gboolean _tmp7_ = FALSE;
	JpegMarker _tmp8_ = 0;
	GError * _inner_error_ = NULL;
#line 203 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	g_return_val_if_fail (G_IS_FILE (file), FALSE);
#line 204 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp0_ = file;
#line 204 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp1_ = g_file_read (_tmp0_, NULL, &_inner_error_);
#line 204 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	fins = _tmp1_;
#line 204 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1796 "JfifSupport.c"
		gboolean _tmp2_ = FALSE;
#line 204 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		g_propagate_error (error, _inner_error_);
#line 204 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		return _tmp2_;
#line 1802 "JfifSupport.c"
	}
#line 207 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp3_ = fins;
#line 207 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp5_ = jpeg_read_marker (_tmp3_, &_tmp4_, &_inner_error_);
#line 207 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	marker = _tmp4_;
#line 207 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	segment_length = _tmp5_;
#line 207 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1814 "JfifSupport.c"
		gboolean _tmp6_ = FALSE;
#line 207 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		g_propagate_error (error, _inner_error_);
#line 207 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		_g_object_unref0 (fins);
#line 207 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		return _tmp6_;
#line 1822 "JfifSupport.c"
	}
#line 210 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp8_ = marker;
#line 210 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	if (_tmp8_ == JPEG_MARKER_SOI) {
#line 1828 "JfifSupport.c"
		gint _tmp9_ = 0;
#line 210 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		_tmp9_ = segment_length;
#line 210 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		_tmp7_ = _tmp9_ == 0;
#line 1834 "JfifSupport.c"
	} else {
#line 210 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		_tmp7_ = FALSE;
#line 1838 "JfifSupport.c"
	}
#line 210 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	result = _tmp7_;
#line 210 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_g_object_unref0 (fins);
#line 210 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	return result;
#line 1846 "JfifSupport.c"
}


gint jpeg_read_marker (GFileInputStream* fins, JpegMarker* marker, GError** error) {
	JpegMarker _vala_marker = 0;
	gint result = 0;
	GDataInputStream* dins = NULL;
	GFileInputStream* _tmp0_ = NULL;
	GDataInputStream* _tmp1_ = NULL;
	GDataInputStream* _tmp2_ = NULL;
	guint8 _tmp3_ = 0U;
	GDataInputStream* _tmp4_ = NULL;
	guint8 _tmp5_ = 0U;
	guint8 _tmp7_ = 0U;
	GDataInputStream* _tmp8_ = NULL;
	guint8 _tmp9_ = 0U;
	gboolean _tmp11_ = FALSE;
	JpegMarker _tmp12_ = 0;
	guint16 length = 0U;
	GDataInputStream* _tmp14_ = NULL;
	guint16 _tmp15_ = 0U;
	guint16 _tmp17_ = 0U;
	guint16 _tmp21_ = 0U;
	GError * _inner_error_ = NULL;
#line 213 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	g_return_val_if_fail (G_IS_FILE_INPUT_STREAM (fins), 0);
#line 214 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_vala_marker = JPEG_MARKER_INVALID;
#line 216 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp0_ = fins;
#line 216 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp1_ = g_data_input_stream_new (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, g_input_stream_get_type (), GInputStream));
#line 216 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	dins = _tmp1_;
#line 217 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp2_ = dins;
#line 217 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	g_data_input_stream_set_byte_order (_tmp2_, G_DATA_STREAM_BYTE_ORDER_BIG_ENDIAN);
#line 219 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp4_ = dins;
#line 219 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp5_ = g_data_input_stream_read_byte (_tmp4_, NULL, &_inner_error_);
#line 219 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp3_ = _tmp5_;
#line 219 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1893 "JfifSupport.c"
		gint _tmp6_ = 0;
#line 219 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		g_propagate_error (error, _inner_error_);
#line 219 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		_g_object_unref0 (dins);
#line 219 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		return _tmp6_;
#line 1901 "JfifSupport.c"
	}
#line 219 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	if (_tmp3_ != JPEG_MARKER_PREFIX) {
#line 220 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		result = -1;
#line 220 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		_g_object_unref0 (dins);
#line 220 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		if (marker) {
#line 220 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
			*marker = _vala_marker;
#line 1913 "JfifSupport.c"
		}
#line 220 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		return result;
#line 1917 "JfifSupport.c"
	}
#line 222 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp8_ = dins;
#line 222 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp9_ = g_data_input_stream_read_byte (_tmp8_, NULL, &_inner_error_);
#line 222 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp7_ = _tmp9_;
#line 222 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1927 "JfifSupport.c"
		gint _tmp10_ = 0;
#line 222 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		g_propagate_error (error, _inner_error_);
#line 222 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		_g_object_unref0 (dins);
#line 222 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		return _tmp10_;
#line 1935 "JfifSupport.c"
	}
#line 222 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_vala_marker = (JpegMarker) _tmp7_;
#line 223 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp12_ = _vala_marker;
#line 223 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	if (_tmp12_ == JPEG_MARKER_SOI) {
#line 223 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		_tmp11_ = TRUE;
#line 1945 "JfifSupport.c"
	} else {
		JpegMarker _tmp13_ = 0;
#line 223 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		_tmp13_ = _vala_marker;
#line 223 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		_tmp11_ = _tmp13_ == JPEG_MARKER_EOI;
#line 1952 "JfifSupport.c"
	}
#line 223 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	if (_tmp11_) {
#line 225 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		result = 0;
#line 225 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		_g_object_unref0 (dins);
#line 225 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		if (marker) {
#line 225 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
			*marker = _vala_marker;
#line 1964 "JfifSupport.c"
		}
#line 225 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		return result;
#line 1968 "JfifSupport.c"
	}
#line 228 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp14_ = dins;
#line 228 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp15_ = g_data_input_stream_read_uint16 (_tmp14_, NULL, &_inner_error_);
#line 228 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	length = _tmp15_;
#line 228 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1978 "JfifSupport.c"
		gint _tmp16_ = 0;
#line 228 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		g_propagate_error (error, _inner_error_);
#line 228 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		_g_object_unref0 (dins);
#line 228 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		return _tmp16_;
#line 1986 "JfifSupport.c"
	}
#line 229 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp17_ = length;
#line 229 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	if (((gint) _tmp17_) < 2) {
#line 1992 "JfifSupport.c"
		guint16 _tmp18_ = 0U;
		GFileInputStream* _tmp19_ = NULL;
		gint64 _tmp20_ = 0LL;
#line 230 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		_tmp18_ = length;
#line 230 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		_tmp19_ = fins;
#line 230 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		_tmp20_ = G_FILE_INPUT_STREAM_GET_CLASS (_tmp19_)->tell (_tmp19_);
#line 230 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		g_debug ("Invalid length %Xh at ofs %" G_GINT64_FORMAT "Xh", _tmp18_, _tmp20_ - 2);
#line 232 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		result = -1;
#line 232 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		_g_object_unref0 (dins);
#line 232 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		if (marker) {
#line 232 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
			*marker = _vala_marker;
#line 2012 "JfifSupport.c"
		}
#line 232 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		return result;
#line 2016 "JfifSupport.c"
	}
#line 236 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_tmp21_ = length;
#line 236 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	result = _tmp21_ - 2;
#line 236 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	_g_object_unref0 (dins);
#line 236 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	if (marker) {
#line 236 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
		*marker = _vala_marker;
#line 2028 "JfifSupport.c"
	}
#line 236 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
	return result;
#line 2032 "JfifSupport.c"
}