summaryrefslogtreecommitdiff
path: root/src/photos/JfifSupport.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/photos/JfifSupport.c')
-rw-r--r--src/photos/JfifSupport.c522
1 files changed, 303 insertions, 219 deletions
diff --git a/src/photos/JfifSupport.c b/src/photos/JfifSupport.c
index baaaf55..190c4c2 100644
--- a/src/photos/JfifSupport.c
+++ b/src/photos/JfifSupport.c
@@ -568,10 +568,10 @@ static PhotoFileFormatFlags jfif_file_format_properties_real_get_flags (PhotoFil
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** _vala_array_dup6 (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);
+static gchar** _vala_array_dup7 (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);
@@ -616,7 +616,9 @@ 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);
+gboolean jpeg_is_jpeg_stream (GInputStream* ins, GError** error);
+gint jpeg_read_marker (GInputStream* fins, JpegMarker* marker, GError** error);
+gboolean jpeg_is_jpeg_bytes (GBytes* bytes, GError** error);
void jfif_file_format_driver_init (void) {
@@ -629,14 +631,14 @@ void jfif_file_format_driver_init (void) {
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"
+#line 635 "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"
+#line 642 "JfifSupport.c"
}
@@ -652,7 +654,7 @@ JfifFileFormatDriver* jfif_file_format_driver_get_instance (void) {
result = _tmp1_;
#line 16 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
return result;
-#line 656 "JfifSupport.c"
+#line 658 "JfifSupport.c"
}
@@ -668,7 +670,7 @@ static PhotoFileFormatProperties* jfif_file_format_driver_real_get_properties (P
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"
+#line 674 "JfifSupport.c"
}
@@ -689,7 +691,7 @@ static PhotoFileReader* jfif_file_format_driver_real_create_reader (PhotoFileFor
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"
+#line 695 "JfifSupport.c"
}
@@ -705,7 +707,7 @@ static PhotoMetadata* jfif_file_format_driver_real_create_metadata (PhotoFileFor
result = _tmp0_;
#line 28 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
return result;
-#line 709 "JfifSupport.c"
+#line 711 "JfifSupport.c"
}
@@ -718,7 +720,7 @@ static gboolean jfif_file_format_driver_real_can_write_image (PhotoFileFormatDri
result = TRUE;
#line 32 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
return result;
-#line 722 "JfifSupport.c"
+#line 724 "JfifSupport.c"
}
@@ -731,7 +733,7 @@ static gboolean jfif_file_format_driver_real_can_write_metadata (PhotoFileFormat
result = TRUE;
#line 36 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
return result;
-#line 735 "JfifSupport.c"
+#line 737 "JfifSupport.c"
}
@@ -752,7 +754,7 @@ static PhotoFileWriter* jfif_file_format_driver_real_create_writer (PhotoFileFor
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"
+#line 758 "JfifSupport.c"
}
@@ -773,7 +775,7 @@ static PhotoFileMetadataWriter* jfif_file_format_driver_real_create_metadata_wri
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"
+#line 779 "JfifSupport.c"
}
@@ -797,7 +799,7 @@ static PhotoFileSniffer* jfif_file_format_driver_real_create_sniffer (PhotoFileF
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"
+#line 803 "JfifSupport.c"
}
@@ -807,14 +809,14 @@ JfifFileFormatDriver* jfif_file_format_driver_construct (GType object_type) {
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"
+#line 813 "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"
+#line 820 "JfifSupport.c"
}
@@ -839,7 +841,7 @@ static void jfif_file_format_driver_class_init (JfifFileFormatDriverClass * klas
((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"
+#line 845 "JfifSupport.c"
}
@@ -853,7 +855,7 @@ static void jfif_file_format_driver_finalize (PhotoFileFormatDriver * obj) {
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"
+#line 859 "JfifSupport.c"
}
@@ -877,14 +879,14 @@ void jfif_file_format_properties_init (void) {
_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"
+#line 883 "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"
+#line 890 "JfifSupport.c"
}
@@ -900,7 +902,7 @@ JfifFileFormatProperties* jfif_file_format_properties_get_instance (void) {
result = _tmp1_;
#line 68 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
return result;
-#line 904 "JfifSupport.c"
+#line 906 "JfifSupport.c"
}
@@ -913,7 +915,7 @@ static PhotoFileFormat jfif_file_format_properties_real_get_file_format (PhotoFi
result = PHOTO_FILE_FORMAT_JFIF;
#line 72 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
return result;
-#line 917 "JfifSupport.c"
+#line 919 "JfifSupport.c"
}
@@ -926,7 +928,7 @@ static PhotoFileFormatFlags jfif_file_format_properties_real_get_flags (PhotoFil
result = PHOTO_FILE_FORMAT_FLAGS_NONE;
#line 76 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
return result;
-#line 930 "JfifSupport.c"
+#line 932 "JfifSupport.c"
}
@@ -942,7 +944,7 @@ static gchar* jfif_file_format_properties_real_get_default_extension (PhotoFileF
result = _tmp0_;
#line 80 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
return result;
-#line 946 "JfifSupport.c"
+#line 948 "JfifSupport.c"
}
@@ -958,28 +960,28 @@ static gchar* jfif_file_format_properties_real_get_user_visible_name (PhotoFileF
result = _tmp0_;
#line 84 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
return result;
-#line 962 "JfifSupport.c"
+#line 964 "JfifSupport.c"
}
-static gchar** _vala_array_dup8 (gchar** self, int length) {
+static gchar** _vala_array_dup6 (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 973 "JfifSupport.c"
+#line 975 "JfifSupport.c"
gchar* _tmp0_;
#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 979 "JfifSupport.c"
+#line 981 "JfifSupport.c"
}
#line 88 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
return result;
-#line 983 "JfifSupport.c"
+#line 985 "JfifSupport.c"
}
@@ -999,7 +1001,7 @@ static gchar** jfif_file_format_properties_real_get_known_extensions (PhotoFileF
#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_);
+ _tmp1_ = (_tmp0_ != NULL) ? _vala_array_dup6 (_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"
@@ -1010,13 +1012,13 @@ static gchar** jfif_file_format_properties_real_get_known_extensions (PhotoFileF
if (result_length1) {
#line 88 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
*result_length1 = _tmp2__length1;
-#line 1014 "JfifSupport.c"
+#line 1016 "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 1020 "JfifSupport.c"
+#line 1022 "JfifSupport.c"
}
@@ -1041,28 +1043,28 @@ static gchar* jfif_file_format_properties_real_get_default_mime_type (PhotoFileF
result = _tmp2_;
#line 92 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
return result;
-#line 1045 "JfifSupport.c"
+#line 1047 "JfifSupport.c"
}
-static gchar** _vala_array_dup9 (gchar** self, int length) {
+static gchar** _vala_array_dup7 (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 1056 "JfifSupport.c"
+#line 1058 "JfifSupport.c"
gchar* _tmp0_;
#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 1062 "JfifSupport.c"
+#line 1064 "JfifSupport.c"
}
#line 96 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
return result;
-#line 1066 "JfifSupport.c"
+#line 1068 "JfifSupport.c"
}
@@ -1082,7 +1084,7 @@ static gchar** jfif_file_format_properties_real_get_mime_types (PhotoFileFormatP
#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_);
+ _tmp1_ = (_tmp0_ != NULL) ? _vala_array_dup7 (_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"
@@ -1093,13 +1095,13 @@ static gchar** jfif_file_format_properties_real_get_mime_types (PhotoFileFormatP
if (result_length1) {
#line 96 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
*result_length1 = _tmp2__length1;
-#line 1097 "JfifSupport.c"
+#line 1099 "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 1103 "JfifSupport.c"
+#line 1105 "JfifSupport.c"
}
@@ -1109,14 +1111,14 @@ JfifFileFormatProperties* jfif_file_format_properties_construct (GType object_ty
self = (JfifFileFormatProperties*) photo_file_format_properties_construct (object_type);
#line 52 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
return self;
-#line 1113 "JfifSupport.c"
+#line 1115 "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 1120 "JfifSupport.c"
+#line 1122 "JfifSupport.c"
}
@@ -1178,7 +1180,7 @@ static void jfif_file_format_properties_class_init (JfifFileFormatPropertiesClas
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 1182 "JfifSupport.c"
+#line 1184 "JfifSupport.c"
}
@@ -1192,7 +1194,7 @@ static void jfif_file_format_properties_finalize (PhotoFileFormatProperties * ob
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 1196 "JfifSupport.c"
+#line 1198 "JfifSupport.c"
}
@@ -1222,21 +1224,21 @@ JfifSniffer* jfif_sniffer_construct (GType object_type, GFile* file, PhotoFileSn
self = (JfifSniffer*) gdk_sniffer_construct (object_type, _tmp0_, _tmp1_);
#line 101 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
return self;
-#line 1226 "JfifSupport.c"
+#line 1228 "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 1233 "JfifSupport.c"
+#line 1235 "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 1240 "JfifSupport.c"
+#line 1242 "JfifSupport.c"
}
@@ -1272,7 +1274,7 @@ static DetectedPhotoInformation* jfif_sniffer_real_sniff (PhotoFileSniffer* base
g_propagate_error (error, _inner_error_);
#line 109 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
return NULL;
-#line 1276 "JfifSupport.c"
+#line 1278 "JfifSupport.c"
}
#line 109 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
if (!_tmp0_) {
@@ -1282,11 +1284,11 @@ static DetectedPhotoInformation* jfif_sniffer_real_sniff (PhotoFileSniffer* base
if (is_corrupted) {
#line 110 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
*is_corrupted = _vala_is_corrupted;
-#line 1286 "JfifSupport.c"
+#line 1288 "JfifSupport.c"
}
#line 110 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
return result;
-#line 1290 "JfifSupport.c"
+#line 1292 "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_);
@@ -1300,7 +1302,7 @@ static DetectedPhotoInformation* jfif_sniffer_real_sniff (PhotoFileSniffer* base
g_propagate_error (error, _inner_error_);
#line 112 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
return NULL;
-#line 1304 "JfifSupport.c"
+#line 1306 "JfifSupport.c"
}
#line 113 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
_tmp5_ = detected;
@@ -1314,11 +1316,11 @@ static DetectedPhotoInformation* jfif_sniffer_real_sniff (PhotoFileSniffer* base
if (is_corrupted) {
#line 114 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
*is_corrupted = _vala_is_corrupted;
-#line 1318 "JfifSupport.c"
+#line 1320 "JfifSupport.c"
}
#line 114 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
return result;
-#line 1322 "JfifSupport.c"
+#line 1324 "JfifSupport.c"
}
#line 116 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
_tmp7_ = detected;
@@ -1326,17 +1328,17 @@ static DetectedPhotoInformation* jfif_sniffer_real_sniff (PhotoFileSniffer* base
_tmp8_ = _tmp7_->file_format;
#line 116 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
if (_tmp8_ == PHOTO_FILE_FORMAT_JFIF) {
-#line 1330 "JfifSupport.c"
+#line 1332 "JfifSupport.c"
DetectedPhotoInformation* _tmp9_;
#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 1336 "JfifSupport.c"
+#line 1338 "JfifSupport.c"
} else {
#line 116 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
_tmp6_ = NULL;
-#line 1340 "JfifSupport.c"
+#line 1342 "JfifSupport.c"
}
#line 116 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
_tmp10_ = _detected_photo_information_ref0 (_tmp6_);
@@ -1348,11 +1350,11 @@ static DetectedPhotoInformation* jfif_sniffer_real_sniff (PhotoFileSniffer* base
if (is_corrupted) {
#line 116 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
*is_corrupted = _vala_is_corrupted;
-#line 1352 "JfifSupport.c"
+#line 1354 "JfifSupport.c"
}
#line 116 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
return result;
-#line 1356 "JfifSupport.c"
+#line 1358 "JfifSupport.c"
}
@@ -1361,7 +1363,7 @@ static void jfif_sniffer_class_init (JfifSnifferClass * klass) {
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 1365 "JfifSupport.c"
+#line 1367 "JfifSupport.c"
}
@@ -1392,21 +1394,21 @@ JfifReader* jfif_reader_construct (GType object_type, const gchar* filepath) {
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 1396 "JfifSupport.c"
+#line 1398 "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 1403 "JfifSupport.c"
+#line 1405 "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 1410 "JfifSupport.c"
+#line 1412 "JfifSupport.c"
}
@@ -1437,14 +1439,14 @@ JfifWriter* jfif_writer_construct (GType object_type, const gchar* filepath) {
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 1441 "JfifSupport.c"
+#line 1443 "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 1448 "JfifSupport.c"
+#line 1450 "JfifSupport.c"
}
@@ -1485,7 +1487,7 @@ static void jfif_writer_real_write (PhotoFileWriter* base, GdkPixbuf* pixbuf, Jp
g_propagate_error (error, _inner_error_);
#line 132 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
return;
-#line 1489 "JfifSupport.c"
+#line 1491 "JfifSupport.c"
}
}
@@ -1495,7 +1497,7 @@ static void jfif_writer_class_init (JfifWriterClass * klass) {
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 1499 "JfifSupport.c"
+#line 1501 "JfifSupport.c"
}
@@ -1526,14 +1528,14 @@ JfifMetadataWriter* jfif_metadata_writer_construct (GType object_type, const gch
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 1530 "JfifSupport.c"
+#line 1532 "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 1537 "JfifSupport.c"
+#line 1539 "JfifSupport.c"
}
@@ -1563,7 +1565,7 @@ static void jfif_metadata_writer_real_write_metadata (PhotoFileMetadataWriter* b
g_propagate_error (error, _inner_error_);
#line 142 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
return;
-#line 1567 "JfifSupport.c"
+#line 1569 "JfifSupport.c"
}
}
@@ -1573,7 +1575,7 @@ static void jfif_metadata_writer_class_init (JfifMetadataWriterClass * klass) {
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 1577 "JfifSupport.c"
+#line 1579 "JfifSupport.c"
}
@@ -1599,7 +1601,7 @@ guint8 jpeg_marker_get_byte (JpegMarker self) {
result = (guint8) self;
#line 160 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
return result;
-#line 1603 "JfifSupport.c"
+#line 1605 "JfifSupport.c"
}
@@ -1621,7 +1623,7 @@ gint jpeg_quality_get_pct (JpegQuality self) {
result = (gint) self;
#line 171 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
return result;
-#line 1625 "JfifSupport.c"
+#line 1627 "JfifSupport.c"
}
@@ -1634,7 +1636,7 @@ gchar* jpeg_quality_get_pct_text (JpegQuality self) {
result = _tmp0_;
#line 175 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
return result;
-#line 1638 "JfifSupport.c"
+#line 1640 "JfifSupport.c"
}
@@ -1661,13 +1663,13 @@ JpegQuality* jpeg_quality_get_all (int* result_length1) {
if (result_length1) {
#line 179 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
*result_length1 = _tmp1__length1;
-#line 1665 "JfifSupport.c"
+#line 1667 "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 1671 "JfifSupport.c"
+#line 1673 "JfifSupport.c"
}
@@ -1677,7 +1679,7 @@ gchar* jpeg_quality_to_string (JpegQuality self) {
switch (self) {
#line 183 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
case JPEG_QUALITY_LOW:
-#line 1681 "JfifSupport.c"
+#line 1683 "JfifSupport.c"
{
gchar* _tmp0_;
#line 185 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
@@ -1686,11 +1688,11 @@ gchar* jpeg_quality_to_string (JpegQuality self) {
result = _tmp0_;
#line 185 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
return result;
-#line 1690 "JfifSupport.c"
+#line 1692 "JfifSupport.c"
}
#line 183 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
case JPEG_QUALITY_MEDIUM:
-#line 1694 "JfifSupport.c"
+#line 1696 "JfifSupport.c"
{
gchar* _tmp1_;
#line 188 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
@@ -1699,11 +1701,11 @@ gchar* jpeg_quality_to_string (JpegQuality self) {
result = _tmp1_;
#line 188 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
return result;
-#line 1703 "JfifSupport.c"
+#line 1705 "JfifSupport.c"
}
#line 183 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
case JPEG_QUALITY_HIGH:
-#line 1707 "JfifSupport.c"
+#line 1709 "JfifSupport.c"
{
gchar* _tmp2_;
#line 191 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
@@ -1712,11 +1714,11 @@ gchar* jpeg_quality_to_string (JpegQuality self) {
result = _tmp2_;
#line 191 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
return result;
-#line 1716 "JfifSupport.c"
+#line 1718 "JfifSupport.c"
}
#line 183 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
case JPEG_QUALITY_MAXIMUM:
-#line 1720 "JfifSupport.c"
+#line 1722 "JfifSupport.c"
{
gchar* _tmp3_;
#line 194 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
@@ -1725,12 +1727,12 @@ gchar* jpeg_quality_to_string (JpegQuality self) {
result = _tmp3_;
#line 194 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
return result;
-#line 1729 "JfifSupport.c"
+#line 1731 "JfifSupport.c"
}
default:
#line 183 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
break;
-#line 1734 "JfifSupport.c"
+#line 1736 "JfifSupport.c"
}
#line 197 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
g_warn_if_reached ();
@@ -1738,7 +1740,7 @@ gchar* jpeg_quality_to_string (JpegQuality self) {
result = NULL;
#line 199 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
return result;
-#line 1742 "JfifSupport.c"
+#line 1744 "JfifSupport.c"
}
@@ -1759,13 +1761,9 @@ gboolean jpeg_is_jpeg (GFile* file, GError** error) {
GFileInputStream* fins = NULL;
GFile* _tmp0_;
GFileInputStream* _tmp1_;
- JpegMarker marker = 0;
- gint segment_length = 0;
- GFileInputStream* _tmp3_;
- JpegMarker _tmp4_ = 0;
- gint _tmp5_;
- gboolean _tmp7_ = FALSE;
- JpegMarker _tmp8_;
+ gboolean _tmp3_ = FALSE;
+ GFileInputStream* _tmp4_;
+ gboolean _tmp5_;
GError * _inner_error_ = NULL;
#line 203 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
g_return_val_if_fail (G_IS_FILE (file), FALSE);
@@ -1777,65 +1775,136 @@ gboolean jpeg_is_jpeg (GFile* file, GError** error) {
fins = _tmp1_;
#line 204 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
if (G_UNLIKELY (_inner_error_ != NULL)) {
-#line 1781 "JfifSupport.c"
+#line 1779 "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 1787 "JfifSupport.c"
+#line 1785 "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"
+#line 205 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+ _tmp4_ = fins;
+#line 205 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+ _tmp5_ = jpeg_is_jpeg_stream (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, g_input_stream_get_type (), GInputStream), &_inner_error_);
+#line 205 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+ _tmp3_ = _tmp5_;
+#line 205 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
if (G_UNLIKELY (_inner_error_ != NULL)) {
-#line 1799 "JfifSupport.c"
+#line 1795 "JfifSupport.c"
gboolean _tmp6_ = FALSE;
-#line 207 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+#line 205 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
g_propagate_error (error, _inner_error_);
-#line 207 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+#line 205 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
_g_object_unref0 (fins);
-#line 207 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+#line 205 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
return _tmp6_;
-#line 1807 "JfifSupport.c"
+#line 1803 "JfifSupport.c"
}
+#line 205 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+ result = _tmp3_;
+#line 205 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+ _g_object_unref0 (fins);
+#line 205 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+ return result;
+#line 1811 "JfifSupport.c"
+}
+
+
+gboolean jpeg_is_jpeg_stream (GInputStream* ins, GError** error) {
+ gboolean result = FALSE;
+ JpegMarker marker = 0;
+ gint segment_length = 0;
+ GInputStream* _tmp0_;
+ JpegMarker _tmp1_ = 0;
+ gint _tmp2_;
+ gboolean _tmp4_ = FALSE;
+ GError * _inner_error_ = NULL;
+#line 208 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+ g_return_val_if_fail (G_IS_INPUT_STREAM (ins), FALSE);
#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 1813 "JfifSupport.c"
- gint _tmp9_;
+ _tmp0_ = ins;
#line 210 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
- _tmp9_ = segment_length;
+ _tmp2_ = jpeg_read_marker (_tmp0_, &_tmp1_, &_inner_error_);
#line 210 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
- _tmp7_ = _tmp9_ == 0;
-#line 1819 "JfifSupport.c"
- } else {
+ marker = _tmp1_;
#line 210 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
- _tmp7_ = FALSE;
-#line 1823 "JfifSupport.c"
- }
+ segment_length = _tmp2_;
#line 210 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
- result = _tmp7_;
+ if (G_UNLIKELY (_inner_error_ != NULL)) {
+#line 1836 "JfifSupport.c"
+ gboolean _tmp3_ = FALSE;
#line 210 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
- _g_object_unref0 (fins);
+ g_propagate_error (error, _inner_error_);
#line 210 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+ return _tmp3_;
+#line 1842 "JfifSupport.c"
+ }
+#line 213 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+ if (marker == JPEG_MARKER_SOI) {
+#line 213 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+ _tmp4_ = segment_length == 0;
+#line 1848 "JfifSupport.c"
+ } else {
+#line 213 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+ _tmp4_ = FALSE;
+#line 1852 "JfifSupport.c"
+ }
+#line 213 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+ result = _tmp4_;
+#line 213 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+ return result;
+#line 1858 "JfifSupport.c"
+}
+
+
+gboolean jpeg_is_jpeg_bytes (GBytes* bytes, GError** error) {
+ gboolean result = FALSE;
+ GMemoryInputStream* mins = NULL;
+ GBytes* _tmp0_;
+ GMemoryInputStream* _tmp1_;
+ gboolean _tmp2_ = FALSE;
+ gboolean _tmp3_;
+ GError * _inner_error_ = NULL;
+#line 216 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+ g_return_val_if_fail (bytes != NULL, FALSE);
+#line 217 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+ _tmp0_ = bytes;
+#line 217 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+ _tmp1_ = (GMemoryInputStream*) g_memory_input_stream_new_from_bytes (_tmp0_);
+#line 217 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+ mins = _tmp1_;
+#line 219 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+ _tmp3_ = jpeg_is_jpeg_stream (G_TYPE_CHECK_INSTANCE_CAST (mins, g_input_stream_get_type (), GInputStream), &_inner_error_);
+#line 219 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+ _tmp2_ = _tmp3_;
+#line 219 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+ if (G_UNLIKELY (_inner_error_ != NULL)) {
+#line 1884 "JfifSupport.c"
+ gboolean _tmp4_ = FALSE;
+#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 (mins);
+#line 219 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+ return _tmp4_;
+#line 1892 "JfifSupport.c"
+ }
+#line 219 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+ result = _tmp2_;
+#line 219 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+ _g_object_unref0 (mins);
+#line 219 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
return result;
-#line 1831 "JfifSupport.c"
+#line 1900 "JfifSupport.c"
}
-gint jpeg_read_marker (GFileInputStream* fins, JpegMarker* marker, GError** error) {
+gint jpeg_read_marker (GInputStream* fins, JpegMarker* marker, GError** error) {
JpegMarker _vala_marker = 0;
gint result = 0;
GDataInputStream* dins = NULL;
- GFileInputStream* _tmp0_;
+ GInputStream* _tmp0_;
GDataInputStream* _tmp1_;
GDataInputStream* _tmp2_;
guint8 _tmp3_ = 0U;
@@ -1849,171 +1918,186 @@ gint jpeg_read_marker (GFileInputStream* fins, JpegMarker* marker, GError** erro
guint16 length = 0U;
GDataInputStream* _tmp14_;
guint16 _tmp15_;
- guint16 _tmp17_;
- guint16 _tmp21_;
+ gboolean _tmp17_ = FALSE;
+ guint16 _tmp18_;
+ guint16 _tmp23_;
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"
+#line 222 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+ g_return_val_if_fail (G_IS_INPUT_STREAM (fins), 0);
+#line 223 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
_vala_marker = JPEG_MARKER_INVALID;
-#line 216 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+#line 225 "/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"
+#line 225 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+ _tmp1_ = g_data_input_stream_new (_tmp0_);
+#line 225 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
dins = _tmp1_;
-#line 217 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+#line 226 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
_tmp2_ = dins;
-#line 217 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+#line 226 "/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"
+#line 228 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
_tmp4_ = dins;
-#line 219 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+#line 228 "/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"
+#line 228 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
_tmp3_ = _tmp5_;
-#line 219 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+#line 228 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
if (G_UNLIKELY (_inner_error_ != NULL)) {
-#line 1878 "JfifSupport.c"
+#line 1948 "JfifSupport.c"
gint _tmp6_ = 0;
-#line 219 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+#line 228 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
g_propagate_error (error, _inner_error_);
-#line 219 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+#line 228 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
_g_object_unref0 (dins);
-#line 219 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+#line 228 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
return _tmp6_;
-#line 1886 "JfifSupport.c"
+#line 1956 "JfifSupport.c"
}
-#line 219 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+#line 228 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
if (_tmp3_ != JPEG_MARKER_PREFIX) {
-#line 220 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+#line 229 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
result = -1;
-#line 220 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+#line 229 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
_g_object_unref0 (dins);
-#line 220 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+#line 229 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
if (marker) {
-#line 220 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+#line 229 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
*marker = _vala_marker;
-#line 1898 "JfifSupport.c"
+#line 1968 "JfifSupport.c"
}
-#line 220 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+#line 229 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
return result;
-#line 1902 "JfifSupport.c"
+#line 1972 "JfifSupport.c"
}
-#line 222 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+#line 231 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
_tmp8_ = dins;
-#line 222 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+#line 231 "/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"
+#line 231 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
_tmp7_ = _tmp9_;
-#line 222 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+#line 231 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
if (G_UNLIKELY (_inner_error_ != NULL)) {
-#line 1912 "JfifSupport.c"
+#line 1982 "JfifSupport.c"
gint _tmp10_ = 0;
-#line 222 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+#line 231 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
g_propagate_error (error, _inner_error_);
-#line 222 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+#line 231 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
_g_object_unref0 (dins);
-#line 222 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+#line 231 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
return _tmp10_;
-#line 1920 "JfifSupport.c"
+#line 1990 "JfifSupport.c"
}
-#line 222 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+#line 231 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
_vala_marker = (JpegMarker) _tmp7_;
-#line 223 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+#line 232 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
_tmp12_ = _vala_marker;
-#line 223 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+#line 232 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
if (_tmp12_ == JPEG_MARKER_SOI) {
-#line 223 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+#line 232 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
_tmp11_ = TRUE;
-#line 1930 "JfifSupport.c"
+#line 2000 "JfifSupport.c"
} else {
JpegMarker _tmp13_;
-#line 223 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+#line 232 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
_tmp13_ = _vala_marker;
-#line 223 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+#line 232 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
_tmp11_ = _tmp13_ == JPEG_MARKER_EOI;
-#line 1937 "JfifSupport.c"
+#line 2007 "JfifSupport.c"
}
-#line 223 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+#line 232 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
if (_tmp11_) {
-#line 225 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+#line 234 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
result = 0;
-#line 225 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+#line 234 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
_g_object_unref0 (dins);
-#line 225 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+#line 234 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
if (marker) {
-#line 225 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+#line 234 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
*marker = _vala_marker;
-#line 1949 "JfifSupport.c"
+#line 2019 "JfifSupport.c"
}
-#line 225 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+#line 234 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
return result;
-#line 1953 "JfifSupport.c"
+#line 2023 "JfifSupport.c"
}
-#line 228 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+#line 237 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
_tmp14_ = dins;
-#line 228 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+#line 237 "/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"
+#line 237 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
length = _tmp15_;
-#line 228 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+#line 237 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
if (G_UNLIKELY (_inner_error_ != NULL)) {
-#line 1963 "JfifSupport.c"
+#line 2033 "JfifSupport.c"
gint _tmp16_ = 0;
-#line 228 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+#line 237 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
g_propagate_error (error, _inner_error_);
-#line 228 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+#line 237 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
_g_object_unref0 (dins);
-#line 228 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+#line 237 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
return _tmp16_;
-#line 1971 "JfifSupport.c"
+#line 2041 "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 1977 "JfifSupport.c"
- guint16 _tmp18_;
- GFileInputStream* _tmp19_;
- gint64 _tmp20_;
-#line 230 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
- _tmp18_ = length;
-#line 230 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+#line 238 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+ _tmp18_ = length;
+#line 238 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+ if (((gint) _tmp18_) < 2) {
+#line 2047 "JfifSupport.c"
+ GInputStream* _tmp19_;
+#line 238 "/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"
+#line 238 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+ _tmp17_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp19_, g_seekable_get_type ());
+#line 2053 "JfifSupport.c"
+ } else {
+#line 238 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+ _tmp17_ = FALSE;
+#line 2057 "JfifSupport.c"
+ }
+#line 238 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+ if (_tmp17_) {
+#line 2061 "JfifSupport.c"
+ guint16 _tmp20_;
+ GInputStream* _tmp21_;
+ gint64 _tmp22_;
+#line 239 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+ _tmp20_ = length;
+#line 239 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+ _tmp21_ = fins;
+#line 239 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+ _tmp22_ = g_seekable_tell (G_TYPE_CHECK_INSTANCE_TYPE (_tmp21_, g_seekable_get_type ()) ? ((GSeekable*) _tmp21_) : NULL);
+#line 239 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+ g_debug ("Invalid length %Xh at ofs %" G_GINT64_FORMAT "Xh", _tmp20_, _tmp22_ - 2);
+#line 242 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
result = -1;
-#line 232 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+#line 242 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
_g_object_unref0 (dins);
-#line 232 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+#line 242 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
if (marker) {
-#line 232 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+#line 242 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
*marker = _vala_marker;
-#line 1997 "JfifSupport.c"
+#line 2081 "JfifSupport.c"
}
-#line 232 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+#line 242 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
return result;
-#line 2001 "JfifSupport.c"
+#line 2085 "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"
+#line 246 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+ _tmp23_ = length;
+#line 246 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+ result = _tmp23_ - 2;
+#line 246 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
_g_object_unref0 (dins);
-#line 236 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+#line 246 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
if (marker) {
-#line 236 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+#line 246 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
*marker = _vala_marker;
-#line 2013 "JfifSupport.c"
+#line 2097 "JfifSupport.c"
}
-#line 236 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
+#line 246 "/home/jens/Source/shotwell/src/photos/JfifSupport.vala"
return result;
-#line 2017 "JfifSupport.c"
+#line 2101 "JfifSupport.c"
}