summaryrefslogtreecommitdiff
path: root/src/photos/GdkSupport.c
blob: 89557110388f30118a78f042f32e73f2ff28e873 (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
/* GdkSupport.c generated by valac 0.36.6, the Vala compiler
 * generated from GdkSupport.vala, do not modify */

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

#include <glib.h>
#include <glib-object.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <stdlib.h>
#include <string.h>
#include <gio/gio.h>


#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;
typedef struct _PhotoFileAdapterPrivate PhotoFileAdapterPrivate;

#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;
typedef struct _PhotoFileReaderPrivate PhotoFileReaderPrivate;

#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_DIMENSIONS (dimensions_get_type ())
typedef struct _Dimensions Dimensions;

#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;
typedef struct _GdkReaderPrivate GdkReaderPrivate;

#define TYPE_PHOTO_FILE_FORMAT (photo_file_format_get_type ())
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _media_metadata_unref0(var) ((var == NULL) ? NULL : (var = (media_metadata_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

#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;
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;

#define PHOTO_FILE_SNIFFER_TYPE_OPTIONS (photo_file_sniffer_options_get_type ())

#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;
typedef struct _GdkSnifferPrivate GdkSnifferPrivate;
#define _detected_photo_information_unref0(var) ((var == NULL) ? NULL : (var = (detected_photo_information_unref (var), NULL)))
#define _g_checksum_free0(var) ((var == NULL) ? NULL : (var = (g_checksum_free (var), NULL)))
typedef struct _DetectedPhotoInformationPrivate DetectedPhotoInformationPrivate;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

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

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

struct _Dimensions {
	gint width;
	gint height;
};

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;
};

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_SNIFFER_OPTIONS_GET_ALL = 0x00000000,
	PHOTO_FILE_SNIFFER_OPTIONS_NO_MD5 = 0x00000001
} PhotoFileSnifferOptions;

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 _GdkSnifferPrivate {
	DetectedPhotoInformation* detected;
	gboolean size_ready;
	gboolean area_prepared;
};

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);
};


static gpointer gdk_reader_parent_class = NULL;
static gpointer gdk_sniffer_parent_class = NULL;

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 dimensions_get_type (void) G_GNUC_CONST;
Dimensions* dimensions_dup (const Dimensions* self);
void dimensions_free (Dimensions* self);
GType gdk_reader_get_type (void) G_GNUC_CONST;
enum  {
	GDK_READER_DUMMY_PROPERTY
};
GType photo_file_format_get_type (void) G_GNUC_CONST;
GdkReader* gdk_reader_construct (GType object_type, const gchar* filepath, PhotoFileFormat file_format);
PhotoFileReader* photo_file_reader_construct (GType object_type, const gchar* filepath, PhotoFileFormat file_format);
static PhotoMetadata* gdk_reader_real_read_metadata (PhotoFileReader* base, GError** error);
PhotoMetadata* photo_metadata_new (void);
PhotoMetadata* photo_metadata_construct (GType object_type);
void media_metadata_read_from_file (MediaMetadata* self, GFile* file, GError** error);
GFile* photo_file_adapter_get_file (PhotoFileAdapter* self);
static GdkPixbuf* gdk_reader_real_unscaled_read (PhotoFileReader* base, GError** error);
gchar* photo_file_adapter_get_filepath (PhotoFileAdapter* self);
static GdkPixbuf* gdk_reader_real_scaled_read (PhotoFileReader* base, Dimensions* full, Dimensions* scaled, GError** error);
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;
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;
GType photo_file_sniffer_options_get_type (void) G_GNUC_CONST;
GType gdk_sniffer_get_type (void) G_GNUC_CONST;
#define GDK_SNIFFER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_GDK_SNIFFER, GdkSnifferPrivate))
enum  {
	GDK_SNIFFER_DUMMY_PROPERTY
};
GdkSniffer* gdk_sniffer_construct (GType object_type, GFile* file, PhotoFileSnifferOptions options);
PhotoFileSniffer* photo_file_sniffer_construct (GType object_type, GFile* file, PhotoFileSnifferOptions options);
static DetectedPhotoInformation* gdk_sniffer_real_sniff (PhotoFileSniffer* base, gboolean* is_corrupted, GError** error);
DetectedPhotoInformation* detected_photo_information_new (void);
DetectedPhotoInformation* detected_photo_information_construct (GType object_type);
static void gdk_sniffer_on_size_prepared (GdkSniffer* self, GdkPixbufLoader* loader, gint width, gint height);
static void _gdk_sniffer_on_size_prepared_gdk_pixbuf_loader_size_prepared (GdkPixbufLoader* _sender, gint width, gint height, gpointer self);
static void gdk_sniffer_on_area_prepared (GdkSniffer* self, GdkPixbufLoader* pixbuf_loader);
static void _gdk_sniffer_on_area_prepared_gdk_pixbuf_loader_area_prepared (GdkPixbufLoader* _sender, gpointer self);
gchar* photo_metadata_exif_hash (PhotoMetadata* self);
gchar* photo_metadata_thumbnail_hash (PhotoMetadata* self);
static guint8* _vala_array_dup5 (guint8* self, int length);
void dimensions_init (Dimensions *self, gint width, gint height);
PhotoFileFormat photo_file_format_from_pixbuf_name (const gchar* name);
static void gdk_sniffer_finalize (PhotoFileSniffer * obj);


GdkReader* gdk_reader_construct (GType object_type, const gchar* filepath, PhotoFileFormat file_format) {
	GdkReader* self = NULL;
	const gchar* _tmp0_;
	PhotoFileFormat _tmp1_;
#line 8 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	g_return_val_if_fail (filepath != NULL, NULL);
#line 9 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp0_ = filepath;
#line 9 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp1_ = file_format;
#line 9 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	self = (GdkReader*) photo_file_reader_construct (object_type, _tmp0_, _tmp1_);
#line 8 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	return self;
#line 309 "GdkSupport.c"
}


static PhotoMetadata* gdk_reader_real_read_metadata (PhotoFileReader* base, GError** error) {
	GdkReader * self;
	PhotoMetadata* result = NULL;
	PhotoMetadata* metadata = NULL;
	PhotoMetadata* _tmp0_;
	GFile* _tmp1_;
	GFile* _tmp2_;
	GError * _inner_error_ = NULL;
#line 12 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_GDK_READER, GdkReader);
#line 13 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp0_ = photo_metadata_new ();
#line 13 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	metadata = _tmp0_;
#line 14 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp1_ = photo_file_adapter_get_file (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter));
#line 14 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp2_ = _tmp1_;
#line 14 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	media_metadata_read_from_file (G_TYPE_CHECK_INSTANCE_CAST (metadata, TYPE_MEDIA_METADATA, MediaMetadata), _tmp2_, &_inner_error_);
#line 14 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_g_object_unref0 (_tmp2_);
#line 14 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 14 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		g_propagate_error (error, _inner_error_);
#line 14 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_media_metadata_unref0 (metadata);
#line 14 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		return NULL;
#line 343 "GdkSupport.c"
	}
#line 16 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	result = metadata;
#line 16 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	return result;
#line 349 "GdkSupport.c"
}


static GdkPixbuf* gdk_reader_real_unscaled_read (PhotoFileReader* base, GError** error) {
	GdkReader * self;
	GdkPixbuf* result = NULL;
	GdkPixbuf* _tmp0_ = NULL;
	gchar* _tmp1_;
	gchar* _tmp2_;
	GdkPixbuf* _tmp3_;
	GdkPixbuf* _tmp4_;
	GdkPixbuf* _tmp5_;
	GError * _inner_error_ = NULL;
#line 19 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_GDK_READER, GdkReader);
#line 20 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp1_ = photo_file_adapter_get_filepath (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter));
#line 20 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp2_ = _tmp1_;
#line 20 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp3_ = gdk_pixbuf_new_from_file (_tmp2_, &_inner_error_);
#line 20 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp4_ = _tmp3_;
#line 20 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_g_free0 (_tmp2_);
#line 20 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp0_ = _tmp4_;
#line 20 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 20 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		g_propagate_error (error, _inner_error_);
#line 20 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		return NULL;
#line 383 "GdkSupport.c"
	}
#line 20 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp5_ = _tmp0_;
#line 20 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp0_ = NULL;
#line 20 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	result = _tmp5_;
#line 20 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_g_object_unref0 (_tmp0_);
#line 20 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	return result;
#line 395 "GdkSupport.c"
}


static GdkPixbuf* gdk_reader_real_scaled_read (PhotoFileReader* base, Dimensions* full, Dimensions* scaled, GError** error) {
	GdkReader * self;
	GdkPixbuf* result = NULL;
	GdkPixbuf* _tmp0_ = NULL;
	gchar* _tmp1_;
	gchar* _tmp2_;
	Dimensions _tmp3_;
	gint _tmp4_;
	Dimensions _tmp5_;
	gint _tmp6_;
	GdkPixbuf* _tmp7_;
	GdkPixbuf* _tmp8_;
	GdkPixbuf* _tmp9_;
	GError * _inner_error_ = NULL;
#line 23 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_GDK_READER, GdkReader);
#line 23 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	g_return_val_if_fail (full != NULL, NULL);
#line 23 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	g_return_val_if_fail (scaled != NULL, NULL);
#line 24 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp1_ = photo_file_adapter_get_filepath (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter));
#line 24 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp2_ = _tmp1_;
#line 24 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp3_ = *scaled;
#line 24 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp4_ = _tmp3_.width;
#line 24 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp5_ = *scaled;
#line 24 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp6_ = _tmp5_.height;
#line 24 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp7_ = gdk_pixbuf_new_from_file_at_scale (_tmp2_, _tmp4_, _tmp6_, FALSE, &_inner_error_);
#line 24 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp8_ = _tmp7_;
#line 24 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_g_free0 (_tmp2_);
#line 24 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp0_ = _tmp8_;
#line 24 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 24 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		g_propagate_error (error, _inner_error_);
#line 24 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		return NULL;
#line 445 "GdkSupport.c"
	}
#line 24 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp9_ = _tmp0_;
#line 24 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp0_ = NULL;
#line 24 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	result = _tmp9_;
#line 24 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_g_object_unref0 (_tmp0_);
#line 24 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	return result;
#line 457 "GdkSupport.c"
}


static void gdk_reader_class_init (GdkReaderClass * klass) {
#line 7 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	gdk_reader_parent_class = g_type_class_peek_parent (klass);
#line 7 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	((PhotoFileReaderClass *) klass)->read_metadata = (PhotoMetadata* (*) (PhotoFileReader *, GError**)) gdk_reader_real_read_metadata;
#line 7 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	((PhotoFileReaderClass *) klass)->unscaled_read = (GdkPixbuf* (*) (PhotoFileReader *, GError**)) gdk_reader_real_unscaled_read;
#line 7 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	((PhotoFileReaderClass *) klass)->scaled_read = (GdkPixbuf* (*) (PhotoFileReader *, Dimensions*, Dimensions*, GError**)) gdk_reader_real_scaled_read;
#line 470 "GdkSupport.c"
}


static void gdk_reader_instance_init (GdkReader * self) {
}


GType gdk_reader_get_type (void) {
	static volatile gsize gdk_reader_type_id__volatile = 0;
	if (g_once_init_enter (&gdk_reader_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (GdkReaderClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gdk_reader_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GdkReader), 0, (GInstanceInitFunc) gdk_reader_instance_init, NULL };
		GType gdk_reader_type_id;
		gdk_reader_type_id = g_type_register_static (TYPE_PHOTO_FILE_READER, "GdkReader", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
		g_once_init_leave (&gdk_reader_type_id__volatile, gdk_reader_type_id);
	}
	return gdk_reader_type_id__volatile;
}


GdkSniffer* gdk_sniffer_construct (GType object_type, GFile* file, PhotoFileSnifferOptions options) {
	GdkSniffer* self = NULL;
	GFile* _tmp0_;
	PhotoFileSnifferOptions _tmp1_;
#line 33 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	g_return_val_if_fail (G_IS_FILE (file), NULL);
#line 34 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp0_ = file;
#line 34 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp1_ = options;
#line 34 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	self = (GdkSniffer*) photo_file_sniffer_construct (object_type, _tmp0_, _tmp1_);
#line 33 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	return self;
#line 504 "GdkSupport.c"
}


static void _gdk_sniffer_on_size_prepared_gdk_pixbuf_loader_size_prepared (GdkPixbufLoader* _sender, gint width, gint height, gpointer self) {
#line 41 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	gdk_sniffer_on_size_prepared ((GdkSniffer*) self, _sender, width, height);
#line 511 "GdkSupport.c"
}


static void _gdk_sniffer_on_area_prepared_gdk_pixbuf_loader_area_prepared (GdkPixbufLoader* _sender, gpointer self) {
#line 42 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	gdk_sniffer_on_area_prepared ((GdkSniffer*) self, _sender);
#line 518 "GdkSupport.c"
}


static guint8* _vala_array_dup5 (guint8* self, int length) {
#line 64 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	return g_memdup (self, length * sizeof (guint8));
#line 525 "GdkSupport.c"
}


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


static DetectedPhotoInformation* gdk_sniffer_real_sniff (PhotoFileSniffer* base, gboolean* is_corrupted, GError** error) {
	GdkSniffer * self;
	gboolean _vala_is_corrupted = FALSE;
	DetectedPhotoInformation* result = NULL;
	DetectedPhotoInformation* _tmp0_;
	GdkPixbufLoader* pixbuf_loader = NULL;
	GdkPixbufLoader* _tmp1_;
	GdkPixbufLoader* _tmp2_;
	GdkPixbufLoader* _tmp3_;
	GChecksum* md5_checksum = NULL;
	gboolean _tmp4_;
	DetectedPhotoInformation* _tmp6_;
	PhotoMetadata* _tmp7_;
	gboolean _tmp12_ = FALSE;
	gboolean _tmp13_;
	guint8* _tmp24_ = NULL;
	gint _tmp24__length1 = 0;
	gint __tmp24__size_ = 0;
	gboolean _tmp25_;
	guint8* buffer = NULL;
	guint8* _tmp28_;
	gint _tmp28__length1;
	gint buffer_length1;
	gint _buffer_size_;
	gsize count = 0UL;
	GFileInputStream* fins = NULL;
	GFile* _tmp29_;
	GFileInputStream* _tmp30_;
	GFileInputStream* _tmp54_;
	gboolean _tmp56_;
	gboolean _tmp61_ = FALSE;
	gboolean _tmp62_;
	DetectedPhotoInformation* _tmp64_;
	DetectedPhotoInformation* _tmp65_;
	GError * _inner_error_ = NULL;
#line 37 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_GDK_SNIFFER, GdkSniffer);
#line 38 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp0_ = detected_photo_information_new ();
#line 38 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_detected_photo_information_unref0 (self->priv->detected);
#line 38 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	self->priv->detected = _tmp0_;
#line 40 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp1_ = gdk_pixbuf_loader_new ();
#line 40 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	pixbuf_loader = _tmp1_;
#line 41 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp2_ = pixbuf_loader;
#line 41 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	g_signal_connect (_tmp2_, "size-prepared", (GCallback) _gdk_sniffer_on_size_prepared_gdk_pixbuf_loader_size_prepared, self);
#line 42 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp3_ = pixbuf_loader;
#line 42 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	g_signal_connect (_tmp3_, "area-prepared", (GCallback) _gdk_sniffer_on_area_prepared_gdk_pixbuf_loader_area_prepared, self);
#line 45 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	md5_checksum = NULL;
#line 46 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp4_ = G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PHOTO_FILE_SNIFFER, PhotoFileSniffer)->calc_md5;
#line 46 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	if (_tmp4_) {
#line 597 "GdkSupport.c"
		GChecksum* _tmp5_;
#line 47 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_tmp5_ = g_checksum_new (G_CHECKSUM_MD5);
#line 47 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_g_checksum_free0 (md5_checksum);
#line 47 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		md5_checksum = _tmp5_;
#line 605 "GdkSupport.c"
	}
#line 49 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp6_ = self->priv->detected;
#line 49 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp7_ = photo_metadata_new ();
#line 49 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_media_metadata_unref0 (_tmp6_->metadata);
#line 49 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp6_->metadata = _tmp7_;
#line 615 "GdkSupport.c"
	{
		DetectedPhotoInformation* _tmp8_;
		PhotoMetadata* _tmp9_;
		GFile* _tmp10_;
#line 51 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_tmp8_ = self->priv->detected;
#line 51 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_tmp9_ = _tmp8_->metadata;
#line 51 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_tmp10_ = G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PHOTO_FILE_SNIFFER, PhotoFileSniffer)->file;
#line 51 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		media_metadata_read_from_file (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, TYPE_MEDIA_METADATA, MediaMetadata), _tmp10_, &_inner_error_);
#line 51 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 630 "GdkSupport.c"
			goto __catch34_g_error;
		}
	}
	goto __finally34;
	__catch34_g_error:
	{
		GError* err = NULL;
		DetectedPhotoInformation* _tmp11_;
#line 50 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		err = _inner_error_;
#line 50 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_inner_error_ = NULL;
#line 54 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_tmp11_ = self->priv->detected;
#line 54 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_media_metadata_unref0 (_tmp11_->metadata);
#line 54 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_tmp11_->metadata = NULL;
#line 50 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_g_error_free0 (err);
#line 651 "GdkSupport.c"
	}
	__finally34:
#line 50 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 50 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		g_propagate_error (error, _inner_error_);
#line 50 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_g_checksum_free0 (md5_checksum);
#line 50 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_g_object_unref0 (pixbuf_loader);
#line 50 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		return NULL;
#line 664 "GdkSupport.c"
	}
#line 57 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp13_ = G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PHOTO_FILE_SNIFFER, PhotoFileSniffer)->calc_md5;
#line 57 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	if (_tmp13_) {
#line 670 "GdkSupport.c"
		DetectedPhotoInformation* _tmp14_;
		PhotoMetadata* _tmp15_;
#line 57 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_tmp14_ = self->priv->detected;
#line 57 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_tmp15_ = _tmp14_->metadata;
#line 57 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_tmp12_ = _tmp15_ != NULL;
#line 679 "GdkSupport.c"
	} else {
#line 57 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_tmp12_ = FALSE;
#line 683 "GdkSupport.c"
	}
#line 57 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	if (_tmp12_) {
#line 687 "GdkSupport.c"
		DetectedPhotoInformation* _tmp16_;
		DetectedPhotoInformation* _tmp17_;
		PhotoMetadata* _tmp18_;
		gchar* _tmp19_;
		DetectedPhotoInformation* _tmp20_;
		DetectedPhotoInformation* _tmp21_;
		PhotoMetadata* _tmp22_;
		gchar* _tmp23_;
#line 58 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_tmp16_ = self->priv->detected;
#line 58 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_tmp17_ = self->priv->detected;
#line 58 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_tmp18_ = _tmp17_->metadata;
#line 58 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_tmp19_ = photo_metadata_exif_hash (_tmp18_);
#line 58 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_g_free0 (_tmp16_->exif_md5);
#line 58 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_tmp16_->exif_md5 = _tmp19_;
#line 59 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_tmp20_ = self->priv->detected;
#line 59 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_tmp21_ = self->priv->detected;
#line 59 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_tmp22_ = _tmp21_->metadata;
#line 59 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_tmp23_ = photo_metadata_thumbnail_hash (_tmp22_);
#line 59 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_g_free0 (_tmp20_->thumbnail_md5);
#line 59 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_tmp20_->thumbnail_md5 = _tmp23_;
#line 720 "GdkSupport.c"
	}
#line 64 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp25_ = G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PHOTO_FILE_SNIFFER, PhotoFileSniffer)->calc_md5;
#line 64 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	if (_tmp25_) {
#line 726 "GdkSupport.c"
		guint8* _tmp26_;
#line 64 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_tmp26_ = g_new0 (guint8, 64 * 1024);
#line 64 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_tmp24_ = (g_free (_tmp24_), NULL);
#line 64 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_tmp24_ = _tmp26_;
#line 64 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_tmp24__length1 = 64 * 1024;
#line 64 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		__tmp24__size_ = _tmp24__length1;
#line 738 "GdkSupport.c"
	} else {
		guint8* _tmp27_;
#line 64 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_tmp27_ = g_new0 (guint8, 8 * 1024);
#line 64 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_tmp24_ = (g_free (_tmp24_), NULL);
#line 64 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_tmp24_ = _tmp27_;
#line 64 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_tmp24__length1 = 8 * 1024;
#line 64 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		__tmp24__size_ = _tmp24__length1;
#line 751 "GdkSupport.c"
	}
#line 64 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp28_ = (_tmp24_ != NULL) ? _vala_array_dup5 (_tmp24_, _tmp24__length1) : ((gpointer) _tmp24_);
#line 64 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp28__length1 = _tmp24__length1;
#line 64 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	buffer = _tmp28_;
#line 64 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	buffer_length1 = _tmp28__length1;
#line 64 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_buffer_size_ = buffer_length1;
#line 65 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	count = (gsize) 0;
#line 68 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp29_ = G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PHOTO_FILE_SNIFFER, PhotoFileSniffer)->file;
#line 68 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp30_ = g_file_read (_tmp29_, NULL, &_inner_error_);
#line 68 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	fins = _tmp30_;
#line 68 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 68 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		g_propagate_error (error, _inner_error_);
#line 68 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		buffer = (g_free (buffer), NULL);
#line 68 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_tmp24_ = (g_free (_tmp24_), NULL);
#line 68 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_g_checksum_free0 (md5_checksum);
#line 68 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_g_object_unref0 (pixbuf_loader);
#line 68 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		return NULL;
#line 785 "GdkSupport.c"
	}
	{
		gboolean _tmp31_ = FALSE;
#line 69 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_tmp31_ = TRUE;
#line 69 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		while (TRUE) {
#line 793 "GdkSupport.c"
			gsize bytes_read = 0UL;
			GFileInputStream* _tmp32_;
			guint8* _tmp33_;
			gint _tmp33__length1;
			gssize _tmp34_;
			gsize _tmp35_;
			gsize _tmp36_;
			gsize _tmp37_;
			gboolean _tmp38_;
			gboolean _tmp42_ = FALSE;
			gboolean _tmp43_;
			gboolean _tmp48_ = FALSE;
			gboolean _tmp49_ = FALSE;
			gboolean _tmp50_;
#line 69 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
			if (!_tmp31_) {
#line 810 "GdkSupport.c"
			}
#line 69 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
			_tmp31_ = FALSE;
#line 70 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
			_tmp32_ = fins;
#line 70 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
			_tmp33_ = buffer;
#line 70 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
			_tmp33__length1 = buffer_length1;
#line 70 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
			_tmp34_ = g_input_stream_read (G_TYPE_CHECK_INSTANCE_CAST (_tmp32_, g_input_stream_get_type (), GInputStream), _tmp33_, (gsize) _tmp33__length1, NULL, &_inner_error_);
#line 70 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
			bytes_read = (gsize) _tmp34_;
#line 70 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
			if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 70 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
				g_propagate_error (error, _inner_error_);
#line 70 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
				_g_object_unref0 (fins);
#line 70 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
				buffer = (g_free (buffer), NULL);
#line 70 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
				_tmp24_ = (g_free (_tmp24_), NULL);
#line 70 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
				_g_checksum_free0 (md5_checksum);
#line 70 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
				_g_object_unref0 (pixbuf_loader);
#line 70 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
				return NULL;
#line 840 "GdkSupport.c"
			}
#line 71 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
			_tmp35_ = bytes_read;
#line 71 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
			if (_tmp35_ <= ((gsize) 0)) {
#line 72 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
				break;
#line 848 "GdkSupport.c"
			}
#line 74 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
			_tmp36_ = count;
#line 74 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
			_tmp37_ = bytes_read;
#line 74 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
			count = _tmp36_ + _tmp37_;
#line 76 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
			_tmp38_ = G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PHOTO_FILE_SNIFFER, PhotoFileSniffer)->calc_md5;
#line 76 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
			if (_tmp38_) {
#line 860 "GdkSupport.c"
				GChecksum* _tmp39_;
				guint8* _tmp40_;
				gint _tmp40__length1;
				gsize _tmp41_;
#line 77 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
				_tmp39_ = md5_checksum;
#line 77 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
				_tmp40_ = buffer;
#line 77 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
				_tmp40__length1 = buffer_length1;
#line 77 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
				_tmp41_ = bytes_read;
#line 77 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
				g_checksum_update (_tmp39_, _tmp40_, _tmp41_);
#line 875 "GdkSupport.c"
			}
#line 80 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
			_tmp43_ = self->priv->size_ready;
#line 80 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
			if (!_tmp43_) {
#line 80 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
				_tmp42_ = TRUE;
#line 883 "GdkSupport.c"
			} else {
				gboolean _tmp44_;
#line 80 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
				_tmp44_ = self->priv->area_prepared;
#line 80 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
				_tmp42_ = !_tmp44_;
#line 890 "GdkSupport.c"
			}
#line 80 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
			if (_tmp42_) {
#line 894 "GdkSupport.c"
				GdkPixbufLoader* _tmp45_;
				guint8* _tmp46_;
				gint _tmp46__length1;
				gsize _tmp47_;
#line 81 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
				_tmp45_ = pixbuf_loader;
#line 81 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
				_tmp46_ = buffer;
#line 81 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
				_tmp46__length1 = buffer_length1;
#line 81 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
				_tmp47_ = bytes_read;
#line 81 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
				gdk_pixbuf_loader_write (_tmp45_, _tmp46_ + 0, (gsize) (((gint) _tmp47_) - 0), &_inner_error_);
#line 81 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
				if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 81 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
					g_propagate_error (error, _inner_error_);
#line 81 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
					_g_object_unref0 (fins);
#line 81 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
					buffer = (g_free (buffer), NULL);
#line 81 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
					_tmp24_ = (g_free (_tmp24_), NULL);
#line 81 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
					_g_checksum_free0 (md5_checksum);
#line 81 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
					_g_object_unref0 (pixbuf_loader);
#line 81 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
					return NULL;
#line 925 "GdkSupport.c"
				}
			}
#line 84 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
			_tmp50_ = G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PHOTO_FILE_SNIFFER, PhotoFileSniffer)->calc_md5;
#line 84 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
			if (!_tmp50_) {
#line 932 "GdkSupport.c"
				gboolean _tmp51_;
#line 84 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
				_tmp51_ = self->priv->size_ready;
#line 84 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
				_tmp49_ = _tmp51_;
#line 938 "GdkSupport.c"
			} else {
#line 84 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
				_tmp49_ = FALSE;
#line 942 "GdkSupport.c"
			}
#line 84 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
			if (_tmp49_) {
#line 946 "GdkSupport.c"
				gboolean _tmp52_;
#line 84 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
				_tmp52_ = self->priv->area_prepared;
#line 84 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
				_tmp48_ = _tmp52_;
#line 952 "GdkSupport.c"
			} else {
#line 84 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
				_tmp48_ = FALSE;
#line 956 "GdkSupport.c"
			}
#line 84 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
			if (_tmp48_) {
#line 85 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
				break;
#line 962 "GdkSupport.c"
			}
		}
	}
	{
		GdkPixbufLoader* _tmp53_;
#line 90 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_tmp53_ = pixbuf_loader;
#line 90 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		gdk_pixbuf_loader_close (_tmp53_, &_inner_error_);
#line 90 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 974 "GdkSupport.c"
			goto __catch35_g_error;
		}
	}
	goto __finally35;
	__catch35_g_error:
	{
		GError* err = NULL;
#line 89 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		err = _inner_error_;
#line 89 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_inner_error_ = NULL;
#line 89 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_g_error_free0 (err);
#line 988 "GdkSupport.c"
	}
	__finally35:
#line 89 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 89 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		g_propagate_error (error, _inner_error_);
#line 89 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_g_object_unref0 (fins);
#line 89 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		buffer = (g_free (buffer), NULL);
#line 89 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_tmp24_ = (g_free (_tmp24_), NULL);
#line 89 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_g_checksum_free0 (md5_checksum);
#line 89 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_g_object_unref0 (pixbuf_loader);
#line 89 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		return NULL;
#line 1007 "GdkSupport.c"
	}
#line 94 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp54_ = fins;
#line 94 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	if (_tmp54_ != NULL) {
#line 1013 "GdkSupport.c"
		GFileInputStream* _tmp55_;
#line 95 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_tmp55_ = fins;
#line 95 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		g_input_stream_close (G_TYPE_CHECK_INSTANCE_CAST (_tmp55_, g_input_stream_get_type (), GInputStream), NULL, &_inner_error_);
#line 95 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 95 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
			g_propagate_error (error, _inner_error_);
#line 95 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
			_g_object_unref0 (fins);
#line 95 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
			buffer = (g_free (buffer), NULL);
#line 95 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
			_tmp24_ = (g_free (_tmp24_), NULL);
#line 95 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
			_g_checksum_free0 (md5_checksum);
#line 95 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
			_g_object_unref0 (pixbuf_loader);
#line 95 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
			return NULL;
#line 1035 "GdkSupport.c"
		}
	}
#line 97 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp56_ = G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PHOTO_FILE_SNIFFER, PhotoFileSniffer)->calc_md5;
#line 97 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	if (_tmp56_) {
#line 1042 "GdkSupport.c"
		DetectedPhotoInformation* _tmp57_;
		GChecksum* _tmp58_;
		const gchar* _tmp59_;
		gchar* _tmp60_;
#line 98 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_tmp57_ = self->priv->detected;
#line 98 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_tmp58_ = md5_checksum;
#line 98 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_tmp59_ = g_checksum_get_string (_tmp58_);
#line 98 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_tmp60_ = g_strdup (_tmp59_);
#line 98 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_g_free0 (_tmp57_->md5);
#line 98 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_tmp57_->md5 = _tmp60_;
#line 1059 "GdkSupport.c"
	}
#line 101 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp62_ = self->priv->size_ready;
#line 101 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	if (!_tmp62_) {
#line 101 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_tmp61_ = TRUE;
#line 1067 "GdkSupport.c"
	} else {
		gboolean _tmp63_;
#line 101 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_tmp63_ = self->priv->area_prepared;
#line 101 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_tmp61_ = !_tmp63_;
#line 1074 "GdkSupport.c"
	}
#line 101 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_vala_is_corrupted = _tmp61_;
#line 103 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp64_ = self->priv->detected;
#line 103 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp65_ = _detected_photo_information_ref0 (_tmp64_);
#line 103 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	result = _tmp65_;
#line 103 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_g_object_unref0 (fins);
#line 103 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	buffer = (g_free (buffer), NULL);
#line 103 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp24_ = (g_free (_tmp24_), NULL);
#line 103 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_g_checksum_free0 (md5_checksum);
#line 103 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_g_object_unref0 (pixbuf_loader);
#line 103 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	if (is_corrupted) {
#line 103 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		*is_corrupted = _vala_is_corrupted;
#line 1098 "GdkSupport.c"
	}
#line 103 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	return result;
#line 1102 "GdkSupport.c"
}


static void gdk_sniffer_on_size_prepared (GdkSniffer* self, GdkPixbufLoader* loader, gint width, gint height) {
	DetectedPhotoInformation* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
#line 106 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	g_return_if_fail (IS_GDK_SNIFFER (self));
#line 106 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	g_return_if_fail (GDK_IS_PIXBUF_LOADER (loader));
#line 107 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp0_ = self->priv->detected;
#line 107 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp1_ = width;
#line 107 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp2_ = height;
#line 107 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	dimensions_init (&_tmp0_->image_dim, _tmp1_, _tmp2_);
#line 108 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	self->priv->size_ready = TRUE;
#line 1124 "GdkSupport.c"
}


static gpointer _g_object_ref0 (gpointer self) {
#line 112 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	return self ? g_object_ref (self) : NULL;
#line 1131 "GdkSupport.c"
}


static void gdk_sniffer_on_area_prepared (GdkSniffer* self, GdkPixbufLoader* pixbuf_loader) {
	GdkPixbuf* pixbuf = NULL;
	GdkPixbufLoader* _tmp0_;
	GdkPixbuf* _tmp1_;
	GdkPixbuf* _tmp2_;
	GdkPixbuf* _tmp3_;
	DetectedPhotoInformation* _tmp4_;
	GdkPixbuf* _tmp5_;
	GdkColorspace _tmp6_;
	DetectedPhotoInformation* _tmp7_;
	GdkPixbuf* _tmp8_;
	gint _tmp9_;
	DetectedPhotoInformation* _tmp10_;
	GdkPixbuf* _tmp11_;
	gint _tmp12_;
	GdkPixbufFormat* format = NULL;
	GdkPixbufLoader* _tmp13_;
	GdkPixbufFormat* _tmp14_;
	DetectedPhotoInformation* _tmp15_;
	GdkPixbufFormat* _tmp16_;
	gchar* _tmp17_;
	DetectedPhotoInformation* _tmp18_;
	DetectedPhotoInformation* _tmp19_;
	const gchar* _tmp20_;
	PhotoFileFormat _tmp21_;
#line 111 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	g_return_if_fail (IS_GDK_SNIFFER (self));
#line 111 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	g_return_if_fail (GDK_IS_PIXBUF_LOADER (pixbuf_loader));
#line 112 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp0_ = pixbuf_loader;
#line 112 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp1_ = gdk_pixbuf_loader_get_pixbuf (_tmp0_);
#line 112 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp2_ = _g_object_ref0 (_tmp1_);
#line 112 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	pixbuf = _tmp2_;
#line 113 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp3_ = pixbuf;
#line 113 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	if (_tmp3_ == NULL) {
#line 114 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		_g_object_unref0 (pixbuf);
#line 114 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
		return;
#line 1180 "GdkSupport.c"
	}
#line 116 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp4_ = self->priv->detected;
#line 116 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp5_ = pixbuf;
#line 116 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp6_ = gdk_pixbuf_get_colorspace (_tmp5_);
#line 116 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp4_->colorspace = _tmp6_;
#line 117 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp7_ = self->priv->detected;
#line 117 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp8_ = pixbuf;
#line 117 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp9_ = gdk_pixbuf_get_n_channels (_tmp8_);
#line 117 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp7_->channels = _tmp9_;
#line 118 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp10_ = self->priv->detected;
#line 118 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp11_ = pixbuf;
#line 118 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp12_ = gdk_pixbuf_get_bits_per_sample (_tmp11_);
#line 118 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp10_->bits_per_channel = _tmp12_;
#line 120 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp13_ = pixbuf_loader;
#line 120 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp14_ = gdk_pixbuf_loader_get_format (_tmp13_);
#line 120 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	format = _tmp14_;
#line 121 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp15_ = self->priv->detected;
#line 121 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp16_ = format;
#line 121 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp17_ = gdk_pixbuf_format_get_name (_tmp16_);
#line 121 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_g_free0 (_tmp15_->format_name);
#line 121 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp15_->format_name = _tmp17_;
#line 122 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp18_ = self->priv->detected;
#line 122 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp19_ = self->priv->detected;
#line 122 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp20_ = _tmp19_->format_name;
#line 122 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp21_ = photo_file_format_from_pixbuf_name (_tmp20_);
#line 122 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_tmp18_->file_format = _tmp21_;
#line 124 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	self->priv->area_prepared = TRUE;
#line 111 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_g_object_unref0 (pixbuf);
#line 1236 "GdkSupport.c"
}


static void gdk_sniffer_class_init (GdkSnifferClass * klass) {
#line 28 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	gdk_sniffer_parent_class = g_type_class_peek_parent (klass);
#line 28 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	((PhotoFileSnifferClass *) klass)->finalize = gdk_sniffer_finalize;
#line 28 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	g_type_class_add_private (klass, sizeof (GdkSnifferPrivate));
#line 28 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	((PhotoFileSnifferClass *) klass)->sniff = (DetectedPhotoInformation* (*) (PhotoFileSniffer *, gboolean*, GError**)) gdk_sniffer_real_sniff;
#line 1249 "GdkSupport.c"
}


static void gdk_sniffer_instance_init (GdkSniffer * self) {
#line 28 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	self->priv = GDK_SNIFFER_GET_PRIVATE (self);
#line 29 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	self->priv->detected = NULL;
#line 30 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	self->priv->size_ready = FALSE;
#line 31 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	self->priv->area_prepared = FALSE;
#line 1262 "GdkSupport.c"
}


static void gdk_sniffer_finalize (PhotoFileSniffer * obj) {
	GdkSniffer * self;
#line 28 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_GDK_SNIFFER, GdkSniffer);
#line 29 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	_detected_photo_information_unref0 (self->priv->detected);
#line 28 "/home/jens/Source/shotwell/src/photos/GdkSupport.vala"
	PHOTO_FILE_SNIFFER_CLASS (gdk_sniffer_parent_class)->finalize (obj);
#line 1274 "GdkSupport.c"
}


GType gdk_sniffer_get_type (void) {
	static volatile gsize gdk_sniffer_type_id__volatile = 0;
	if (g_once_init_enter (&gdk_sniffer_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (GdkSnifferClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gdk_sniffer_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GdkSniffer), 0, (GInstanceInitFunc) gdk_sniffer_instance_init, NULL };
		GType gdk_sniffer_type_id;
		gdk_sniffer_type_id = g_type_register_static (TYPE_PHOTO_FILE_SNIFFER, "GdkSniffer", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
		g_once_init_leave (&gdk_sniffer_type_id__volatile, gdk_sniffer_type_id);
	}
	return gdk_sniffer_type_id__volatile;
}